I have a server running Debian 6 with two static IP addresses assigned: eth0 and eth0:1 (virtual interface of eth0). On boot, both should get their assigned IPs...but eth0 does not.
/etc/network/interfaces
:
iface eth0 inet static
address 192.168.9.171
netmask 255.255.255.0
network 192.168.9.0
broadcast 192.168.9.255
gateway 192.168.9.23
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.9.23 192.168.9.41
dns-search ourdomain.local
auto eth0:1
iface eth0:1 inet static address 192.168.9.11 netmask 255.255.255.0 network 192.168.9.0 broadcast 192.168.9.255 gateway 192.168.9.23 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 192.168.9.23 192.168.9.41 dns-search ourdomain.local
ifconfig
:
eth0 Link encap:Ethernet HWaddr 00:12:79:95:a4:e7
inet6 addr: fe80::212:79ff:fe95:a4e7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10378 errors:0 dropped:8 overruns:0 frame:0
TX packets:2256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1634657 (1.5 MiB) TX bytes:453396 (442.7 KiB)
Interrupt:17
eth0:1 Link encap:Ethernet HWaddr 00:12:79:95:a4:e7
inet addr:192.168.9.11 Bcast:192.168.9.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:17
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:550 errors:0 dropped:0 overruns:0 frame:0
TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:189714 (185.2 KiB) TX bytes:189714 (185.2 KiB)
Any ideas? The only way it'll get an IP is if I do ifconfig eth0 192.168.9.171
.
That is your problem, by default debian comes with: allow-hotplug eth0
Check out the official documentation here: http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_basic_syntax_of_etc_network_interfaces