Debian//etc/network/interfaces

From Useful Things
Jump to: navigation, search

DHCP setup

auto eth0
iface eth0 inet dhcp

Static IP setup

auto eth0
iface eth0 inet static
	address 192.168.100.2
	netmask 255.255.255.248
	gateway 192.168.100.1

Secondary IP / alias interface setup

auto eth0:0
iface eth0:0 inet static
	address 123.123.123.123
	netmask 255.255.255.255

Extra startup commands

auto eth0:0
iface eth0:0 inet static
	address 123.123.123.123
	netmask 255.255.255.255
	up ip route change default via 192.168.100.1 dev eth0 src 123.123.123.123