NIC Teaming on Ubuntu 17.10 via netplan

6,244

Solution 1

Required three fixes:

  1. Changed bridges to bonds.
  2. Added nameserver
  3. For true NIC teaming resiliency split the two NICs into separate interfaces for bond0

Final netplan:

network:
    version: 2
    ethernets:
        eth0:
            match: 
                macaddress: 00:15:5d:ec:d3:07
            wakeonlan: true
        eth1:
            match:               
                macaddress: 00:15:5d:ec:d3:08
            wakeonlan: true
    bonds:
        bond0:
            interfaces: [eth0, eth1]
            addresses: [172.30.1.10/18]
            gateway4: 172.30.0.1
            nameservers:
                addresses: [172.30.0.1]

Solution 2

This is /etc/netplan/01-netcfg.yaml That I have set up on my DL380 for 4 link aggregation.

network:
version: 2
renderer: networkd
ethernets:
  enp3s0f0:
    dhcp4: false
    dhcp6: false
  enp3s0f1:
    dhcp4: false
    dhcp6: false
  enp4s0f0: 
    dhcp4: false
    dhcp6: false
  enp4s0f1: 
    dhcp4: false
    dhcp6: false
bonds:
  bond0:
    dhcp4: false
    dhcp6: false
    interfaces: 
      - enp3s0f0
      - enp3s0f1
      - enp4s0f0
      - enp4s0f1
    addresses: [192.168.1.156/24]
    gateway4: 192.168.1.1
    parameters:
      mode: 802.3ad
    nameservers:
      addresses: [8.8.8.8,8.8.4.4,84.200.69.80,84.200.70.40]
Share:
6,244

Related videos on Youtube

James Dudley
Author by

James Dudley

Updated on September 18, 2022

Comments

  • James Dudley
    James Dudley almost 2 years

    Attempting to NIC team on Ubuntu 17.10 using netplan:

    network:
        version: 2
        ethernets:
            switchports:
                match: 
                    macaddress: 00:15:5d:ec:d3:07
                    macaddress: 00:15:5d:ec:d3:08
                wakeonlan: true
        bridges:
            bond0:
                interfaces: [switchports]
                addresses: [172.30.1.10/18]
                gateway4: 172.30.0.1
    

    After applying cannot ping gateway or ping Ubuntu server from other network nodes. My hunch is I'm missing something simple but reading docs and other examples I'm at a loss :/

    Here's ip addr show:

    [...]
    2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:15:5d:ec:d3:07 brd ff:ff:ff:ff:ff:ff
    3: eth0: <BROADCAST,MULTICAST,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 00:15:5d:ec:d3:08 brd ff:ff:ff:ff:ff:ff
    4: bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ae:1e:0c:06:21:8c brd ff:ff:ff:ff:ff:ff
    inet 172.30.1.10/18 brd 172.30.63.255 scope global bond0
        valid_lft forever preferred_lft forever
    inet6 fe80::ac1e:cff:fe06:218c/64 scope link
        valid_lft_forever preferred_lft forever
    [...]
    

    Update 1: Changes bridges to bonds: as Mark Wagner pointed out.

    Pinging gateway is now working but DNS resolution isn't.

    ping google.com
    ping: google.com: Temporary failure in name resolution
    

    Tried setting name-servers manually using netplan but still no luck:

    network:
        version: 2
    ....
            gateway4: 172.30.0.1
            nameservers: 
                addresses: [172.30.0.1, 8.8.8.8]
    

    Here are the contents of cat /proc/net/bonding/bond0:

    Bonding Mode: load balancing (round-robin)
    MII Status: up
    MII Polling Interval (ms): 0
    Up Delay (ms): 0
    Down Delay (ms): 0
    
    Slave Interface: eth1
    MII Status: up
    Speed: 1000 Mbps
    Duplex: full
    Link Failure Count: 0
    Permanent HW addr: 00:15:5d:ec:d3:08
    Slave queue ID: 0
    

    Update 2: Rebooting the machine fixed DNS

    • MastaJeet
      MastaJeet over 6 years
      What is in /proc/net/bonding/bond0?
    • MastaJeet
      MastaJeet over 6 years
      Also, bridges: should not be present. A bond is not a bridge.
    • James Dudley
      James Dudley over 6 years
      @MarkWagner - Changed bridges to bonding: which fixed pinging gateway! DNS still not resolving. Updated post to reflect my steps.
  • timss
    timss over 6 years
    Thanks for sharing. This could've been pretty consise if not for all the dhcp4/6: false statements for alle the slave interfaces, do you know if it was it necessary in order for it to work? Sounds annoying if that's default behavior in Netplan.