Linux双网卡绑定

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值