LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-20-2022, 08:01 PM   #1
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Rep: Reputation: Disabled
Ethernet device presenting two IP addresses


Hi
I'm having an issue where the ethernet device is giving me two IP addresses (IPV4)

Quote:
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
The first address listed (192.168.1.157) is causing me some grief. The preferred address is the second (192.168.1.18), which I had set as static.

Can I get some help in removing the unwanted address?

Thanks

Last edited by FrizzledOldButt; 11-20-2022 at 08:02 PM.
 
Old 11-20-2022, 08:07 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,326
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
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.
 
Old 11-20-2022, 08:23 PM   #3
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
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
 
Old 11-20-2022, 08:40 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,326
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Boy, this is a strange one. It's probably going to take someone who knows more than me to help with this one.

Is is possible that at some time the machine was configured to have multiple ip addresses?
 
Old 11-20-2022, 08:57 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,705

Rep: Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898
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.
 
Old 11-21-2022, 12:13 AM   #6
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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.

Many thanks for the advice.
 
Old 11-21-2022, 07:18 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,705

Rep: Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898Reputation: 5898
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.
 
Old 11-21-2022, 05:21 PM   #8
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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.
 
Old 11-21-2022, 05:46 PM   #9
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 129

Original Poster
Rep: Reputation: Disabled
I found this in man nm-settings

secondaries:

Quote:
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.
 
  


Reply

Tags
networking



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lightweight live CD OS to display information (for a presenting to an audience) theocoreduro Linux - General 6 11-18-2009 12:01 PM
Reading data from bkuetooth device presenting hidraw interface prabhat_h Programming 0 08-31-2009 07:50 AM
openSUSE 10.3 not presenting a user login screen.. DeekBeek SUSE / openSUSE 5 10-31-2007 07:33 PM
LXer: Presenting source code text with Eclipse CDT LXer Syndicated Linux News 0 09-22-2006 09:54 AM
Dual boot not presenting LILO jnsg Slackware 37 03-02-2005 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration