Ubuntu 20.04 bond4 配置 |
您所在的位置:网站首页 › bond配置vlan › Ubuntu 20.04 bond4 配置 |
一、netplay 方式,增加如下配置文件,修改完重启机器。 cat /etc/netplan/02-bond-config.yaml network: version: 2 ethernets: ens49f0: addresses: [] dhcp4: no optional: true ens49f1: addresses: [] dhcp4: no optional: true bonds: bond0: interfaces: - ens49f0 - ens49f1 parameters: mode: 802.3ad mii-monitor-interval: 100 addresses: - "172.18.103.47/24" gateway4: "172.18.103.254"二、传统/etc/network/interfaces 方式,Ubuntu 16及之前版本默认是这种,如果人为修改了Ubuntu 20的网络配置方式,也可以使用。修改完后,如果重启网卡无效可能需要重启服务器。 经测试ip通了,后再次重启服务器网络也能正常通。 #install packages # NOTE: ensure ifenslave 2.6 is what gets installed, required for VLANs apt-get install -y ifenslave vlan #load modules manually to be sure modprobe 8021q modprobe bonding #add to modules for reboots echo 'bonding' >> /etc/modules echo '8021q' >> /etc/modules /etc/network/interfaces 配置bond4.100即带vlan100的举例,lan2和lan3是要做bond的对应网卡: auto lo iface lo inet loopback auto lan2 iface lan2 inet manual bond-master bond4 auto lan3 iface lan3 inet manual bond-master bond4 auto bond4 iface bond4 inet manual slaves lan2 lan3 bond-mode 4 bond-miimon 100 bond-lacp-rate 1 bond-slaves none bond-xmit-hash-policy layer3+4 auto bond4.100 iface bond4.100 inet static address 10.10.11.100 netmask 255.255.255.0 gateway 10.10.11.1 vlan-raw-device bond4 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |