0

I am changing my configuration from dhcp to static. After running ifdown/ifup ifconfig does not reflect the change. Running systemctl restart did not reflect the change. Rebooting did.

/etc/network/interfaces:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback

/etc/network/interfaces.d/primary:
auto eth0
iface eth0 inet dhcp

DHCP returns:
address was 192.168.0.5
mask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
network 192.168.0.0
dns-nameservers 192.168.0.1

/etc/network/interfaces.d/primary was edited to:
auto eth0
iface eth0 inet static
address 192.168.0.244
mask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
network 192.168.0.0
dns-nameservers 192.168.0.1

upon save ran sudo ifdown eth0
sudo ifup eth0

Afterwards ifconfig still returned the 192.168.0.5 address

I tried again using the --force option on ifup with the same result.

I then tried systemctl restart networking.service and ifconfig still reported the 192.168.0.5 address.

None of these commands appeared to apply the change in the configuration file. Rebooting, however, did apply the change correctly so I believe the static configuration I created is correct.

  • First, you're just telling us a story about a problem, NOT describing a problem. What do all those changed lines look like? What are the results of the commands you ran? – waltinator Jun 7 '18 at 16:57
  • Please don't post additional information in the comments field. Edit ( askubuntu.com/posts/1044543/edit ) your post to add the new information, and format it properly with the {} button – waltinator Jun 7 '18 at 21:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.