7 linux 配置链路聚合_RHEL7 学习笔记30——配置链路聚合和桥接

RHEL7 学习笔记30——配置链路聚合和桥接

一、聚合网络

聚合网络team的类型:

1、activebackup;

2、loadbalence;

3、roundrobin;

二、配置聚合网络

三种方式:

1、命令行;

2、配置文件;

3、图形化界面;

1、命令行方式:

添加team0

[root@linuxidc ~]# nmcli connection add con-name team0 type team ifname team0 config {"runner":{"name":"activebackup"}}

配置IP地址:

[root@linuxidc ~]# nmcli connection modify team0 ipv4.addresses "192.168.10.100/24"

[root@linuxidc ~]# nmcli connection modify team0 ipv4.method manual

添加接口,在添加之前,确保添加的接口的连接已删除:

[root@linuxidc ~]# nmcli connection add con-name team0-port1 ifname ens34 type team-slave master team0

[root@linuxidc ~]# nmcli connection add con-name team0-port1 ifname ens38 type team-slave master team0

编辑ifcfg-team0配置文件,在这行加上单引号和双引号:

TEAM_CONFIG='{"runner":{"name":"activebackup"}}'

重启网络服务:

[root@linuxidc network-scripts]# systemctl restart network

此时看到team0和绑定的2张网卡的Mac地址变为一致:

查看team0的工作状态:

[root@linuxidc ~]# teamdctl team0 state

setup:

runner: activebackup

ports:

ens38

link watches:

link summary: up

instance[link_watch_0]:

name: ethtool

link: up

ens34

link watches:

link summary: up

instance[link_watch_0]:

name: ethtool

link: up

runner:

active port: ens34

2、配置文件

1 DEVICE=team0

2 DEVICETYPE=Team

3 ONBOOT=yes

4 BOOTPROTO=none

5 IPADDR=192.168.10.100

6 NETWORK=255.255.255.0

7 TEAM_CONFIG='{"runner":{"name":"roundrobin"}}'

1 DEVICE=ens34

2 DEVICETYPE=TeamPort

3 ONBOOT=yes

4 BOOTPROTO=none

5 TEAM_MASTER=team0

使用teamnl命令查看team的选项和端口:

[root@linuxidc network-scripts]# teamnl team0 ports

8: ens34: up 1000Mbit FD

4: ens38: up 1000Mbit FD

12345678910111213141516 [root@linuxidc network-scripts]# teamnl team0 options

queue_id (port:ens34) 0

priority (port:ens34) 0

user_linkup_enabled (port:ens34) false

user_linkup (port:ens34) true

enabled (port:ens34) true

queue_id (port:ens38) 0

priority (port:ens38) 0

user_linkup_enabled (port:ens38) false

user_linkup (port:ens38) true

enabled (port:ens38) true

mcast_rejoin_interval 0

mcast_rejoin_count 0

notify_peers_interval 0

notify_peers_count 0

mode roundrobin

[root@linuxidc network-scripts]# teamnl team0 getoption mode

3、图形化配置界面

打开nm-connection-editor,添加一个新连接:

三、配置桥接网络

1、使用brctl命令

查看桥接网络:

[root@linuxidc ~]# systemctl restart network

[root@linuxidc ~]# brctl show

bridge namebridge idSTP enabledinterfaces

virbr08000.000000000000yes

添加桥接网络:

[root@linuxidc ~]# brctl addbr br0

添加接口:

[root@linuxidc ~]# brctl addif ens34 br0

2、使用nmcli命令

[root@linuxidc ~]# nmcli connection add con-name br1 type bridge ifname br1

[root@linuxidc ~]# nmcli connection modify br1 ipv4.addresses "192.168.20.20/24,192.168.20.1"

[root@linuxidc ~]# nmcli connection modify br1 ipv4.method manual

[root@linuxidc ~]# nmcli connection add con-name br1-port1 type bridge-slave ifname ens34 master br1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值