I have a VM (on ESXi 5.1.0) running Debian Wheezy (7.0).
eth0 has a statically assigned address. eth1 was DHCP-assigned, and now I want to make it static.
Here is my old /etc/network/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 eth0 eth1
iface lo inet loopback
# The primary network interface
allow-hotplug eth0 eth1
iface eth0 inet static
address 10.2.1.77
broadcast 10.2.1.255
netmask 255.255.255.0
pointopoint 10.2.1.1
iface eth1 inet dhcp
And here is my new /etc/network/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 eth0 eth1
iface lo inet loopback
# The primary network interface
allow-hotplug eth0 eth1
iface eth0 inet static
address 10.2.1.77
broadcast 10.2.1.255
netmask 255.255.255.0
pointopoint 10.2.1.1
iface eth1 inet static
address 10.1.0.254
netmask 255.255.255.0
gateway 10.1.0.1
dns-nameservers 8.8.8.8
When I reboot, I can see dhcpcd
try to renew my lease for my old DHCP-assigned address, and succeed. And then it overwrites /etc/resolv.conf
, which should contain 8.8.8.8 but does not. eth1 does have the correct (static) address, however.
What am I doing wrong here? I don't want to disable dhcpcd
outright. In the near future I might switch eth1 back to DHCP, or add a third DHCP-assigned interface.