RHEL7.6
查看网卡信息
# nmcli device
# nmcli connection show
# nmcli connection delete ens192
# nmcli connection delete ens224
# nmcli connection show
1、创建绑定网卡bond0 并设置IP地址
#nmcli connection add type bond ifname bond0 con-name bond0 miimon 100 mode active-backup primary enp1s0f0 ipv4.method manual ipv4.addresses 10.0.100.183/24 ipv4.gateway 10.0.100.1
2、创建bond0的子接口
# nmcli connection add type bond-slave ifname enp1s0f0 con-name bond0-enp1s0f0 master bond0
# nmcli connection add type bond-slave ifname enp1s0f1 con-name bond0-en01s0f1 master bond0
3、查看并激活的网络接口
# nmcli connection show --active
# nmcli connection up bond0-enp1s0f0
# nmcli connection up bond0-enp1s0f1
# nmcli connection up bond0
# nmcli connection down enp1s0f0
# 给enp1s0f0和enp1s0f1改名
debian12
1、安装netplan.io
2、在/etc/netplan目录下编辑01-netplan-bond.yaml
network:
version: 2
renderer: networkd
ethernet:
eth0:
dhcp4: no
eth1:
dhcp4: no
bonds:
bond0:
interfaces:
- eth0
- eth1
parameters:
mode: active-backup
primary: eth0
mii-monitor-interval: 100
bridges:
br0:
interfaces: [bond0]
dhcp4: no
addresses: [192.168.1.10/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
3、应用: netplan apply
麒麟V10 Sp3
nmcli connection add type bond ifname bond0 con-name bond0 mode active-backup
nmcli connection modify bond0 ipv4.method manual ipv4.addresse 192.168.250.246 ipv4.gateway 192.168.250.1 ipv6.method ignore
nmcli con add type bond-slave ifname em3 master bond0
nmcli con add type bond-slave ifname em4 master bond0