[Solved]LAN problem on linux

On multiboot linux box with 3 distros (all debian based). All works fine on 2 distros, but 1 is faulty. General things: OpenWrt using DHCP but with static leases, so each OS gets a unique and static IP on boot. The working OSes respond properly with ping and ssh using the host info from the router (OpenWrt). The faulty OS seems to be hanging unto old info from the previous router&setup:

ubun ~ # ping debian
PING debian.oldsubdomain.net ( 56(84) bytes of data

Where debian.oldsubdomain.net is obsolete, and the real IP is not found though it exists in the router's host name and static lease sections.
I've tried purging software that might be doing this, like dnsmasq, bind etc. The local /etc hosts file has no reference. Yet this persists despite a machine reboot. Internet does work OK on this OS and it does show the proper static lease IP. Some other info:

ubun ~ # ifconfig 
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fefe::1c1c:5656:4444:cccc  prefixlen 64  scopeid 0x20<link>
        ether 30:cc:33:88:99:dd  txqueuelen 1000  (Ethernet)
        RX packets 8936  bytes 9245210 (9.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5808  bytes 993672 (993.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xdf300000-df320000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 936  bytes 75700 (75.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 936  bytes 75700 (75.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
ubun ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 enp0sffff     U     1000   0        0 enp0sffff   U     100    0        0 enp0sffff

In particular, I rely on ssh for LAN work, so I need to fix this...thx

It looks like your system is getting an IP from the OpenWrt router without any problems. Check your linux host for hostname/IP assignments -- I suspect it is a local issue within that specific host.

Clearly, this is an issue on the local OS, but I've already checked /etc/hosts, .ssh/config, /etc/network/interfaces, Network Manager, as well as all the GUI avenues I can think of. How else can this old domain name be holding on? Even pinging openwrt has it:

ron@ubun $ ping openwrt
PING openwrt.olddomain.net ( 56(84) bytes of data.

Clean arp tables ???

Have you tried doing that same ping from other devices on your local network (phone, another computer, etc.)? And have you tried it from the router itself?

@Pippo cleaned arp tables using both arp ip cmds, no joy even after reboot.
@psherman yes, other distros on same tower, the router and even a wifi laptop with the same version of Ubuntu install...all ping and ssh as expected. I hate to reinstall the OS, but I'm really lost as to why this is happening. Usually, it's something simple I'm just overlooking...:disappointed_relieved:

On faulty OS, doing $ ping does correctly ping the router and using the numerical IP address does correctly ping other LAN devices. So I'm thinking it must be some sort of dns thing...but I've hit all the obvious ones I can think of.

Do a grep for the old domain name in your /etc at first and then expand the perimeter to other folders. Maybe it is in a file that you didn't think of.

Often the hostname resides in 2 places: /etc/hostname and /etc/hosts. You might also have it in the dnsmasq.conf file. And if you setup mdns on that system, it might be living somewhere else (like avahi or similar) and might be getting picked up by some other part of the system when you attempt to ping it.

OK, tried good suggestions from @trendy and @psherman ...ie avahi No joy...going to drop this for a while...tired of beating my head against it. I have 2 good working distros on the tower and others on laptops. Later, I'll do some research on ubuntu forums...since openwrt is NOT the problem. Thx for your help...If I find the problem (w/o re-installing ubuntu) I'll post it here.

Install wireshark on the fault OS and inspect traffic to/from router. Could it help ?

1 Like
sudo grep -rl "olddomain" /etc 2>/dev/null
grep -Ev "^(#|$)" /etc/nsswitch.conf /etc/resolv.conf /etc/hosts /etc/hostname

A bit more research. The prog "network-manager" presents a gui interface in ubuntu > preferences/administration. The file created is /etc/NetworkManager/Wired connection 1. In that file is a line for [IPv4] dns-search=olddomain.net. However, that option does not appear in the gui interface (that I can see). I think it used to, but is not in the latest distro update. In any case, I used a heavy handed method to remove it and will probably have to re-install & reconfigure ubuntu.

So, I restored ubuntu from a recent image (fully configured...thx fsarchiver). Of course the bad line

was still there. The easy way to get rid of it is to stop wired connections, create a new wired connection and use that to restart the connection. Now ubuntu pings the router and the rest of the LAN as it should. Network Manager's connection files live in: /etc/NetworkManager/system-connections. Once the new profile is built, one can delete the defective one. Hope this helps someone else.

nmcli connection modify "Wired connection 1" ipv4.dns-search ""

Have you actually tried that? Not saying it wouldn't work, but a manual edit of the file certainly doesn't. In any case, someone looking here could try, if the change persists...good to go. If not, making a new wired connection is not too hard either.

It certainly would after reconnect.
You'd better study NetworkManager documentation.

NetworkManager reads connection data only on service startup and operates connection parameters in memory afterwards.
Manual edit can break permissions resulting in connection activation failure or produce backup file leading to collision.

C’mon just edit the file and restart the service

Why people don’t try to help each other here ???

Look for something like this relevant to your distro


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.