前情提要 #
服务器配置了两张网卡,现在需要做 bond0。
网关: 192.168.0.1 网卡一: eno8303 (192.168.0.2) 网卡二: eno8403 (192.168.0.3)
创建 bond0 #
sudo nmcli con add type bond con-name bond0 ifname bond0 mode 802.3ad miimon 100 updelay 200 downdelay 200
绑定网卡到 bond0 #
sudo nmcli con add type ethernet con-name bond0-slave1 ifname eno8303 master bond0
sudo nmcli con add type ethernet con-name bond0-slave2 ifname eno8403 master bond0
修改 bond0 配置 #
sudo nmcli con mod bond0 ipv4.addresses "192.168.0.100/24"
sudo nmcli con mod bond0 ipv4.gateway "192.168.0.1"
sudo nmcli con mod bond0 ipv4.dns "223.5.5.5"
sudo nmcli con mod bond0 ipv4.method manual
sudo nmcli con mod bond0 connection.autoconnect yes
sudo nmcli con up bond0
sudo nmcli con up bond0-slave1
sudo nmcli con up bond0-slave2
# 删除 bond0
# sudo nmcli con delete bond0
修改系统 route #
sudo ip route add default via 192.168.0.1 dev bond0 proto static metric 300