Can't change to static IP

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
netsense

Can't change to static IP

Post by netsense »

Hi all,

I'm baffled, trying the change the network interface from a DHCP lease to a static IP.

I have tried both methods outlines in https://linuxhint.com/change-from-dhcp- ... ss-ubuntu/, and the result stubbornly stays on the DHCP-assigned IP.

The current content of my /stc/network/interfaces files is
interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# iface dsl-provider inet ppp
# pre-up /sbin/ifconfig --help up # line maintained by pppoeconf
# provider dsl-provider

auto eth0
# iface eth0 inet dhcp
iface eth0 inet static
address 10.1.1.10
netmask 255.0.0.0
gateway 10.1.1.1
dns-nameservers 10.1.1.1 8.8.8.8
And after trying the second method, it appears the network -manager configuration is lost altogether, and will not accept new connections: the screenshot of the applet is attached:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
davidmedin

Re: Can't change to static IP

Post by davidmedin »

I believe it should be greyed out because you've configured networking manually. Did you do systemctl restart network to apply the changes?
netsense

Re: Can't change to static IP

Post by netsense »

David

Yes I did. No errors reported, and no change in IP.

Edwin
davidmedin

Re: Can't change to static IP

Post by davidmedin »

Ok, what is the name of your Ethernet connection in ifconfig - is it something like enp0s25? I think you need to use enp0s25 instead of eth0?
netsense

Re: SOLVED: Can't change to static IP

Post by netsense »

Thanks guys.

The problem is solved.

The answer was a weird one: we had a permanently assigned DHCP address and associated port forward for the box on a Cisco router. It wasn't until after the DHCP assignment on the router was removed that the IP address on the box magically changed. So I'm assuming the Linux box was saying "I want to be 10.1.1.10", and the Cisco box was replying "No, you're 10.1.1.100" and the Linux box was meekly complying. Or some such anthropomorphisation. :)
All good, now
Locked

Return to “Networking”