System version: Ubuntu 14.04 (4.4.0)
Create bonding
1. The system automatically loads the bonding module
cat /etc/timefileTime "#" is ignored.bonding
2. Installing the Ifenslave Plugin
Install Ifenslave
3. Configure the NIC
cat /etc/network//etc/network/interfaces.d/*# the loopback network Interfaceauto Loiface Lo inet loopbackup ifenslave bond0 enp0s3 enp0s8down ifenslave-d bond0 enp0s3 enp0s8auto bond0iface bond0 inet dh CP #此处配置需要正常启动, otherwise the module 4 device fails Bond-mode 4bond-miimon 100bond-slaves enp0s3 enp0s8
Creating VLANs
1. The system automatically loads the 8021q module
cat /etc/timefileTime "#" is ignored.bonding8021q
2. Configure the NIC
cat /etc/network//etc/network/interfaces.d/*# the loopback network Interfaceauto Loiface Lo inet loopbackup ifenslave bond0 enp0s3 enp0s8down ifenslave-d bond0 enp0s3 enp0s8auto bond0iface bond0 inet dh Cpbond-mode 4bond-miimon 100bond-slaves enp0s3 enp0s8auto vlan41iface vlan41 inet staticaddress 192.168.10.10netmask 255.255.255.0network 192.168.10.0broadcast 192.168.10.255vlan-raw-device bond0
Note: 1. The bonding module supports a bond by default, if you need to create 2 bond, configure/etc/modprobe.d/bonding.conf * (Options bonding max_bonds=2)
2. If the NIC needs to boot and does not require IP, use manual (Dhcp/static/manual)
Script Small Note:
[Email protected]:/home/ubuntu#Cat/etc/network/interfaces# Thisfiledescribes the network interfaces available on your system# and how to activate them. for Moreinformation, see Interfaces (5). SOURCE/etc/network/interfaces.d/*# The loopback network Interfaceauto loiface lo inet loopbackup (ifenslave bond0 enp0s3; Ifenslave bond1 enp0s8) down (ifenslave-d bond0 enp0s3; ifenslave-d bond1 enp0s8) Auto bond0iface bond0 inet dhcpbond-mode 4bond-miimon 100bond-slaves enp0s3auto bond1iface bond1 inet staticbond-mode 0bond-miimon 100address 192.168.230.100netmask 255.255.255.0network 192.168.230.0broadcast 192.168.230.255auto vlan41iface vlan41 inet staticaddress 192.168.10.10netmask 255.255.255.0network 192.168.10.0broadcast 192.168.10.255vlan-raw-device Bond1
Ubuntu bonding + VLAN