Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Two Ethernet Ports - Swap/Disappear

  1. #1
    Join Date
    Mar 2013
    Beans
    21

    Two Ethernet Ports - Swap/Disappear

    Hi All

    I'm running Ubuntu 20.04 LTS on a old server board S1200BTL as a home server. The motherboard has two ethernet ports. I connect to my LAN via a B525 Huawei wireless router. The home server is hard wired to the wireless router via the ethernet port.

    My problem is that after a restart or startup the ethernet port sometimes disappears so that to get it to re-appear I must then unplug the ethernet cable from the one port on the server and plug it into the other. Then the network re-appears. This manual swapping of the ports is a real pain as the PC is not super accessible.

    Any ideas as to why it swaps or how if it does keep swapping I can get both to be automatically enabled?

    Forgot to say I have eth0 and eno1 showing and ethernet controllers are Intel 82579LM and 82574L.

    Thanks in advance.
    Last edited by jphat; June 22nd, 2020 at 01:53 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,542
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Two Ethernet Ports - Swap/Disappear

    DHCP or static IPs specified on the system using netplan?
    The DHCP server may be slow.
    The router port many be starting to fail.
    The ethernet cable may be starting to fail.
    The ethernet ports on the "old server" may be starting to fail and jiggling the connection is sufficient.
    Systemd-Networking may not be configured correctly.

    I have a Debian virtual machine that sometimes doesn't find any network adapter at boot, but once it does, it is up until I have to bring the VM down. Then it is a 50:50 chance at the next boot whether the virtio NIC will be found or not. The host machine doesn't have any network issues. The other VMs on the system don't have any issues with networking at boot either, using the same driver and same bridge connection.

    To see the boot messages:
    Code:
    $ dmesg |grep eth
    [    0.910969] virtio_net virtio0 ens3: renamed from eth0
    May need to tweak the regex (eth) a little for your setup.

  3. #3
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    25,321
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Two Ethernet Ports - Swap/Disappear

    Code:
    DHCP or static IPs specified on the system using netplan?
    We hope so. If hat is the case, Mr. TheFu and I will like to see the file:

    Code:
    cat /etc/netplan/*.yaml
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D., Sc.D.

  4. #4
    Join Date
    Mar 2013
    Beans
    21

    Re: Two Ethernet Ports - Swap/Disappear

    Thanks for the assistance; in the first:

    dmesg |grep eth
    [ 0.861792] e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) 00:1e:67:1a:23:61
    [ 0.861793] e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
    [ 0.861830] e1000e 0000:00:19.0 eth0: MAC: 10, PHY: 11, PBA No: 0100FF-0FF
    [ 0.984225] e1000e 0000:02:00.0 eth1: (PCI Express:2.5GT/s:Width x1) 00:1e:67:1a:23:60
    [ 0.984226] e1000e 0000:02:00.0 eth1: Intel(R) PRO/1000 Network Connection
    [ 0.984314] e1000e 0000:02:00.0 eth1: MAC: 3, PHY: 8, PBA No: 1000FF-0FF
    [ 0.985150] e1000e 0000:00:19.0 eno1: renamed from eth0

    Then,
    cat /etc/netplan/*.yaml
    # Let NetworkManager manage all devices on this system
    network:
    version: 2
    renderer: NetworkManager

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,542
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Two Ethernet Ports - Swap/Disappear

    Quote Originally Posted by jphat View Post
    Thanks for the assistance; in the first:

    dmesg |grep eth
    [ 0.861792] e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) 00:1e:67:1a:23:61
    [ 0.861793] e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
    [ 0.861830] e1000e 0000:00:19.0 eth0: MAC: 10, PHY: 11, PBA No: 0100FF-0FF
    [ 0.984225] e1000e 0000:02:00.0 eth1: (PCI Express:2.5GT/s:Width x1) 00:1e:67:1a:23:60
    [ 0.984226] e1000e 0000:02:00.0 eth1: Intel(R) PRO/1000 Network Connection
    [ 0.984314] e1000e 0000:02:00.0 eth1: MAC: 3, PHY: 8, PBA No: 1000FF-0FF
    [ 0.985150] e1000e 0000:00:19.0 eno1: renamed from eth0

    Then,
    cat /etc/netplan/*.yaml
    # Let NetworkManager manage all devices on this system
    network:
    version: 2
    renderer: NetworkManager
    Netplan YAML files are indentation specific. When posting here, you ABSOLUTELY MUST use code tags for any YAML file configurations. There's no other option. The "advanced editor" has a '#' button to be used just like a quote or bold ... Wrap the YAML in that or we'll have to assume bad formatting.

    If this is a server install, then network-manager is useless. On a desktop, perhaps you can do something through a GUI?
    If it was me, I'd not use network manager on any server. You can configure the static IP for the NIC you want in a netplan yaml file.
    Something like this:
    Code:
    network:
        version: 2
        renderer: networkd
        ethernets:
            eth0:
                addresses:
                - 172.22.22.90/24
                dhcp4: false
                dhcp6: false
                gateway4: 172.22.22.1
                nameservers:
                    addresses: [ "172.22.22.80", "1.1.1.1" ]
                    search: []
    Obviously, replace the values above for your needs. IP, netmask, gateway and your internal DNS server are probably best. Be certain that whatever IP you choose on the network is outside the DHCP managed range. On my network, I've setup 200-254 as DHCP managed. .199 and lower are for static IPs. Every network is different.

    Watch the spacing and indentation. If they are wrong, it won't work.

    I'd create+edit a file using sudoedit /etc/netplan/01-eth0-static.yaml, then run
    Code:
    sudo netplan generate
    sudo netplan apply --debug
    to get it enabled.

    If you need help with specific values, most your modifications.

  6. #6
    Join Date
    Mar 2013
    Beans
    21

    Re: Two Ethernet Ports - Swap/Disappear

    Sorry about the code tags. A bit of fiddling with the yaml file (new to me) seems to be working for now. I set eth1 and eno1 the same.
    Code:
    :~$ cat /etc/netplan/*.yaml
    # Let NetworkManager manage all devices on this system
    network:
      version: 2
      renderer: NetworkManager
      ethernets:
        eth0:
          addresses:
            - 192.168.8.100/24
          dhcp4: false
          dhcp6: false
          gateway4: 192.168.8.1
          nameservers:
              addresses: [ 8.8.8.8, 8.8.4.4 ]
        eno1:
          addresses:
            - 192.168.8.100/24
          dhcp4: false
          dhcp6: false
          gateway4: 192.168.8.1
          nameservers:
              addresses: [ 8.8.8.8, 8.8.4.4 ]
    All good? Thanks for the help.
    Josh

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,542
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Two Ethernet Ports - Swap/Disappear

    No. You cannot have 2 NICs on the same IP. Actually, having 2 NICs on the same subnet is a bad idea when you don't understand networking. Problems will happen. Best to NOT setup eno1 at all.

    And the comment in the 1st line isn't true anymore. Delete it.

  8. #8
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,020
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Two Ethernet Ports - Swap/Disappear

    As I understand it, only one NIC is plugged in. It's just that their IDs keep swapping when it reboots. The original question was how to prevent them from swapping so that the same physical port always gets the same name.

    This page https://netplan.io/examples has an example which has a match macaddress clause which might work. But I can't help feeling that there must be a lower-level way of pinning the interface names.

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,542
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Two Ethernet Ports - Swap/Disappear

    Technically, it is possible to have NICs on the same subnet. People do that for automatic failover using cluster software and virtual IPs. They also do that for bonded connections, but the switch(es) they connect into need to support those protocols. Average home routers do not. A "managed switch" is usually required at the minimum with the specific ports spelled out. The metric for each interface needs to be set correctly too.

    As shown above, problems are likely due to the settings. https://ubuntuforums.org/showthread....9#post13962629 has a bonded network setup, but it is for a KVM host and bridge on a network infrastructure that supports bonding.

  10. #10
    Join Date
    Mar 2013
    Beans
    21

    Re: Two Ethernet Ports - Swap/Disappear

    I was unsure if I could use the same 2 IP addresses on the two NICs. I tried editing the yaml file so one was 192.168.8.99 and the other 192.168.8.100 (both outside the range served by the router). It didn't work. Both ways with the file (same and different IPs) as it was it only seems to connect eno1 and never eth1.

    My intention is that I avoid the adapters swapping at random so that it's always on but also that either adapter will always work so that if the server cable is unplugged and plugged in again but in the other port (such as would happen in the house where some other family member moves things around) it still connects without any other fiddling.

    What do you mean by: "And the comment in the 1st line isn't true anymore. Delete it." If you mean the:
    # Let NetworkManager manage all devices on this system
    line then I though networkmanager is managing as it is listed under renderer: NetworkManager

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •