Can't change to static IP

Questions about cabled networking
Forum rules
Before you post please read how to get help
Post Reply
netsense
Level 1
Level 1
Posts: 45
Joined: Fri Feb 08, 2013 12:58 am

Can't change to static IP

Post by netsense » Wed Dec 27, 2017 5:43 pm

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:
Attachments
nm.png

davidmedin
Level 2
Level 2
Posts: 52
Joined: Tue Nov 28, 2017 2:56 am

Re: Can't change to static IP

Post by davidmedin » Wed Dec 27, 2017 6:21 pm

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

netsense
Level 1
Level 1
Posts: 45
Joined: Fri Feb 08, 2013 12:58 am

Re: Can't change to static IP

Post by netsense » Thu Dec 28, 2017 1:53 am

David

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

Edwin

davidmedin
Level 2
Level 2
Posts: 52
Joined: Tue Nov 28, 2017 2:56 am

Re: Can't change to static IP

Post by davidmedin » Thu Dec 28, 2017 9:04 am

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
Level 1
Level 1
Posts: 45
Joined: Fri Feb 08, 2013 12:58 am

Re: SOLVED: Can't change to static IP

Post by netsense » Thu Dec 28, 2017 9:55 pm

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

Post Reply

Return to “Ethernet”