RHCE 一

实验要求:

        在当前主机添加两块网卡,将两块网卡绑定实现网卡冗余操作。


1、添加两块网卡
        1)、打开虚拟机设置,点击网络适配器,然后添加。

        2)、添加两个网络适配器,如图下所示:

       


2、激活网卡 
        1)、查看本地网卡的情况

```

[root@localhost ~]# nmcli device 
DEVICE  TYPE      STATE                   CONNECTION         
ens160  ethernet  connected               ens160             
ens224  ethernet  connected               Wired connection 2 
ens256  ethernet  connected               Wired connection 1 
virbr0  bridge    connected (externally)  virbr0             
lo      loopback  unmanaged               --    

 ``` 
        2)、激活网卡

```

[root@localhost ~]# nmcli device connect ens224
Device 'ens224' successfully activated with '86d51163-1571-3b91-974e-c2c8654e7b64'.
[root@localhost ~]# nmcli device connect ens256
Device 'ens256' successfully activated with '3fecf83b-5e95-3aea-98f0-6657af5c80ae'.

```
        3)、通过ip a可以看到本地网卡的地址信息

3、添加 虚拟网卡team0

```
[root@localhost ~]# nmcli connection add type team ifname team0 con-name team0 config '{"runner":{"name":"activebackup"}}'
Connection 'team0' (492ad39e-a2a3-4009-bbaa-1be78de79839) successfully added.

```
4、虚拟网卡绑定真实网卡

```
[root@localhost ~]# nmcli connection add type team-slave ifname ens224 con-name team0-port1 master team0
Connection 'team0-port1' (c9a8a1e7-6ed3-4a96-aa59-188220a09b99) successfully added.
[root@localhost ~]# nmcli connection add type team-slave ifname ens256 con-name team0-port2 master team0
Connection 'team0-port2' (34240370-bf76-472f-b1ad-4a879e0728e5) successfully added.
        通过ip a可以看出team0并没有被激活

```

5、激活team0 
        1)、激活顺序:先从再主

```

[root@localhost ~]# nmcli connection up team0-port1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
[root@localhost ~]# nmcli connection up team0-port2
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9)
[root@localhost ~]# nmcli connection up team0
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/10)
```
        2)、查看当前的会话


 6、测试网卡绑定状态

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值