Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Are you using DHCP? One option might be to configure a static ip address. Precisely how to do that will depend on what distro you are using.
What is the "ethernet device" to which you refer and do you have access to it? I ask because it seems to me that there's something not quite right with it if it's doling out two ip adddresses to the same machine.
Are you using DHCP? One option might be to configure a static ip address. Precisely how to do that will depend on what distro you are using.
Using Ubuntu Server 20.04 -
The address I want (192.168.1.18) is declared as static.
I suspected DHCP assigning the second address, but AFAIK there is no DHCP service running on the server; "sudo systemctl status dhcpcd" reports no such service, and I cannot see anything relatable in /etc/systemd and its sub directories.
I thought maybe legacy issues, because the server was originally set up with Ubuntu Server 16.04, but I just cannot see anything :-(
Quote:
What is the "ethernet device" to which you refer and do you have access to it? I ask because it seems to me that there's something not quite right with it if it's doling out two ip adddresses to the same machine.
The device is enp1s0 -I used "ip a" to interrogate the network on the server. As an aside, I was using ifconfig, but it didn't show the 192.168.1.157 address. Other forums suggested ifconfig was obsolete and to use ip instead.
> ip a reports the two addresses:
Quote:
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d4:3d:7e:48:ac:5b brd ff:ff:ff:ff:ff:ff inet 192.168.1.157/24 brd 192.168.1.255 scope global noprefixroute enp1s0
valid_lft forever preferred_lft forever inet 192.168.1.18/24 brd 192.168.1.255 scope global secondary noprefixroute enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::62af:afba:7d9c:3cb9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
How did you set 192.168.1.18 as a static IP address?
Quote:
inet 192.168.1.18/24 brd 192.168.1.255 scope global secondary noprefixroute enp1s0
It is a secondary address and having multiple addresses assigned to the same interface is quite legal. You can delete the first by using the IP command.
Quote:
do ip addr del inet 192.168.1.157/24 dev enp1s0
Now how is 192.168.1.157 being added to enp1s0 is the next question. It looks like a static address too. How is it being configured,
Network Manager, configuration file etc.
How did you set 192.168.1.18 as a static IP address?
It was set with nm-connection-editor around about Ubuntu 18.04 (4 yrs ago?)
Quote:
It is a secondary address and having multiple addresses assigned to the same interface is quite legal. You can delete the first by using the IP command.
OK, thanks. I was holding a fear that deleting with ip might break something. Anyway, had to drop the inet in your instruction - it gave an error
I did
Code:
sudo ip addr del 192.168.1.157/24 dev enp1s0
This did the trick.
Quote:
Now how is 192.168.1.157 being added to enp1s0 is the next question. It looks like a static address too. How is it being configured,
Network Manager, configuration file etc.
Network Manager, unless as I mentioned, I have some legacy issue from early Ubuntu server installations.
NB: I haven't rebooted, but did do a network manager restart. It seems to be holding.
Running the command is just a manual deletion and not persistent. It's not being added via network manager. We will see what happens when you reboot.
Correct. It came back.
However, I think I identified the cause; the nmconfiguration file for the ethernet card in /etc/NetworkManager/system-connections had the following entry:
Quote:
secondaries=a92022fb-3d8f-4162-83b8-48180dc2fa47;
I couldn't find a reference to "secondaries", but made an assumption that it may have contributed. I commented it out and rebooted.
All good. The troublesome IP address is gone.
Cheers & thanks for the info.
Last edited by FrizzledOldButt; 11-21-2022 at 05:29 PM.
List of connection UUIDs that should be activated when the base connection itself is activated. Currently only VPN connections are supported.
enp1s0 had been configured from the GUI to auto start a VPN connection. However, after commenting out secondaries & rebooting the VPN connection wasn't initiated.
So, it seems that the IP address 192.168.1.157 had something to do with the VPN, i.e. it appeared when the auto start for the VPN occurred.
I'll start the VPN manually until I get my head around this.
Last edited by FrizzledOldButt; 11-21-2022 at 05:49 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.