大网数据广告活动
服务器运维问答

NIC Teaming on Ubuntu 17.10 via netplan

· 52CE 我爱测

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] addres…

问题原文

原帖链接 · James Dudley · CC BY-SA 3.0

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

已采纳解答

原帖链接 · James Dudley · CC BY-SA 3.0

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]

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。