Network configuration with /etc/network/interfaces

When you use Debian Linux, you can administrate your network settings via /etc/network/interfaces.
Here’s a simple example to demonstrate syntax and parameters of the configuration file.

# loopback interface
auto lo
iface lo inet loopback
# Interface eth0 gets its IP via DHCP
auto eth0
iface eth0 inet dhcp
# Static IP for eth1
auto eth1
iface eth1 inet static
  # Default gateway not set, because eth0 gets it via DHCP
  # gateway
  # Log status and set route for network, when Interface comes up
  up route add -net netmask gw dev $IFACE
  up /usr/bin/logger -t network "Interface $IFACE came up"
  # Log status and delete route for network, when Interface goes down
  down route del -net netmask gw dev $IFACE
  down /usr/bin/logger -t network "Interface $IFACE went down"

There is the start script /etc/rcS.d/S40networking, which is executing ifup -a.
So, all interfaces with the keyword auto will be brought up while boot time.

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>