Linux运维第二十一讲

1.ipv6的设置

nm-connection-editor

删除原有的网卡

nmcli connection add con-name wula ifname eth0 type ethernet ip6 2017::ff4/48

ifconfig

通过ping6自己的地址,看是否创建成功


2.高级网络设置

2.1 网桥的设置

  902  cd /etc/sysconfig/network-scripts

  903  ls

  904  mv ifcfg-br0 ifcfg-enp0s25 /mnt/ ##移除

  905  nm-connection-editor

在这里面删除两个25结尾的,而后重新建立一个文件

  909  cd /etc/sysconfig/network-scripts/

  911  vim ifcfg-enp0s25

DEVICE=enp0s25

ONBOOT=yes

BOOTPROTO=none

BRIDGE=br0

  912  vim ifcfg-br0

DEVICE=br0

ONBOOT=yes

BOOTPROTO=none

TYPE=Bridge

IPADDR=172.25.254.24

PREFIX=24

DSN1=172.25.254.250

GATEWAY=172.25.254.250

  913  systemctl stop NetworkManager.service

  914  systemctl restart network

  915  systemctl start NetworkManager

  916  brctl show

[root@foundation24 network-scripts]# brctl show

bridge name bridge id STP enabled interfaces

br0 8000.0021ccba60cc no enp0s25

virbr0 8000.5254004630e8 yes virbr0-nic

virbr1 8000.525400b27411 yes virbr1-nic

 

2.2 对网桥的管理

虚拟机设置:

   设置网桥:

nm-connection-editor

删除原有的

brctl show

brctl addbr br0

brctl addif br0 eth0

ifconfig br0 172.25.254.124 netmask 255.255.255.0

ping 172.25.254.250 ##此时可以ping通

   开始删除网桥:

brctl delif br0 eth0

ping 172.25.254.250 ##此时ping不通

ifconfig br0 down

brctl delbr br0


2.3 网卡的绑定

首先给虚拟机增加一块网卡,做到网卡轮循

  bond类型(最多只能挂两个网卡):

nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.124/24

ping 172.25.254.250 ##此时ping不通

nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0

ping 172.25.254.250 ##此时可以ping通

nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0

此时可用另一个shell查看ping的情况

ifconfig eth0 down ##人为破坏一个

此时可以观察到eth1顶替上去

ifconfig eth0 up ##待eth0修复后更换上去

监控网卡论寻命令: watch -n 1 cat /proc/net/bonding/bond0

用ping命令,监控是否在一个网卡出错的情况下,另一个补位




 team类型(最多可挂载7,8个):

先卸掉bond0

nmcli connection delete eth0

nmcli connection delete eth1

nmcli connection delete bond0

*************************************************

nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.124/24

ping 172.25.254.250 ##此时ping不通

nmcli connection add con-name eth0 ifname eth0 type team-slave master team0

ping 172.25.254.250 ##此时可以ping通

nmcli connection add con-name eth1 ifname eth1 type team-slave master team0

ifconfig eth0 down ##人为破坏一个

此时可以观察到eth1顶替上去

ifconfig eth0 up ##待eth0修复后更换上去

监控网卡论寻命令; watch -n 1 teamdctl team0 stat

用ping命令,监控是否在一个网卡出错的情况下,另一个补位




 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值