Changing a static IP (Rasbian Stretch)
Note: I have "net.ifnames=0" in /boot/cmdline.txt so that I get the old interface names (eth0 etc) back. I've always worked with /etc/network/interfaces in the past, but Googling suggests the correct way to set a static IP is now to edit /etc/dhcpcd.conf and append: interface eth0 static ip_address=192.168.0.28/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.5 If I restart dhcpcd or networking: sudo service networking restart .. then the new IP address gets added, but the old IP address gets retained until reboot. (Regardless of whether the old IP came from DHCP or was a previous static.) What am I doing wrong? Note: If there's a better way to set a static IP then I'm happy to look at that instead. -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
On 12/09/2017 16:46, Mark Rogers wrote:
I've always worked with /etc/network/interfaces in the past, but Googling suggests the correct way to set a static IP is now to edit /etc/dhcpcd.conf and append:
I just nuked dhcpcd and edited /etc/network/interfaces as before. -- Red to red, black to black, switch it on, but stand well back.
On 13 September 2017 at 09:01, Bill Hill <mail@wbh.org> wrote:
I just nuked dhcpcd and edited /etc/network/interfaces as before.
By "nuked" do you mean "apt remove dhcpcd" or something else? -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
On 13/09/2017 10:49, Mark Rogers wrote:
On 13 September 2017 at 09:01, Bill Hill <mail@wbh.org> wrote:
I just nuked dhcpcd and edited /etc/network/interfaces as before.
By "nuked" do you mean "apt remove dhcpcd" or something else?
sudo nice -20 apt purge dhcpcd ;-) -- Red to red, black to black, switch it on, but stand well back.
On 13 September 2017 at 13:38, Bill Hill <mail@wbh.org> wrote:
sudo nice -20 apt purge dhcpcd
Ah, the Kim Jong approach... -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
participants (2)
-
Bill Hill -
Mark Rogers