Re: Handling static ip address configuration using /etc/network/interface
Roy Marples
Tue Nov 04 09:01:22 2014
Hi Amit
On 04/11/2014 00:38, Amit Uttamchandani wrote:
> Our system uses Ubuntu 12.04LTS which comes with dhcpcd 6.0.5. When a
> user configures a static IP using our software, we regenerate
> /etc/network/interfaces. It looks like the following:
>
> auto lo
> iface lo inet loopback
>
> allow-hotplug eth0
> iface eth0 inet static
> address 192.168.1.253
> netmask 255.255.255.0
> gateway 192.168.1.1
>
> On reboot, dhcpcd acquires an IP address from the DHCP server. Thus, the
> unit ends up with two IP addresses.
>
> Should dhcpcd respect the configuration in /etc/network/interfaces? Has
> this been fixed in the newer releases?
No and no.
dhcpcd only accepts configuration via dhcpcd.conf or the commandline.
It does not look at per distro configuration.
It could be possible to get the init script to add the deny interfaces,
or allow interfaces directive to the command line moving forwards.
Hopefully someone more proficient than me with the Debian style
networking can patch that.
> What is the recommended way to ignore this interface when it is
> configured statically?
Add this to /etc/dhcpcd.conf, right at the top
denyinterfaces eth0
Thanks
Roy
Archive administrator: postmaster@marples.name