Interfaces

Example layout of the Debian/Ubuntu /etc/interfaces config file with static IP configuration including additional routing, alias and VLAN details.

interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The LAN network interface
auto eth0
allow-hotplug eth0
#iface eth0 inet dhcp
  iface eth0 inet static
  address 192.168.2.10
  network 192.168.2.0
  netmask 255.255.255.0
  broadcast 192.168.2.255
  up route add -net 192.168.210.8/29 gw 192.168.2.2
  down route del -net 192.168.210.8/29 gw 192.168.2.2
  dns-nameservers 192.168.2.1 192.168.2.2
  dns-search home.lan
  gateway 192.168.2.1

# VLAN config:
auto eth0.200
  iface eth0.3 inet static
  address 192.168.200.10
  network 192.168.200.0
  netmask 255.255.255.0
  broadcast 192.168.200.255
  vlan_raw_device eth0

# Alias config:
#auto eth0:1
#  iface eth0:1 inet static
#  address 192.168.201.9
#  network 192.168.201.0
#  netmask 255.255.255.0
#  broadcast 192.168.201.255

Just a reminder:
To make VLANs work you'll need the 8021q kernel module:

modprobe 8021q
echo 8021q >> /etc/modules
networking/interfaces.txt · Last modified: 2014-11 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready