高级网络配置

来源:互联网 发布:手机免费聊天软件 编辑:程序博客网 时间:2024/06/05 06:00

########team链路聚合###

1.team也是链路聚合的一种方式
最多支持8块网卡
支持模式:
广播容错  broadcast
轮询          roundrobin 
主备          activebackup
负载均衡  loadbalance
2.配置
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.106/24
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
3.测试
watch -n 1 teamdctl team0 stat
ifconfig eth0 down

ifconfig eth0 up


########网桥######

配置方式
vim /etc/sysconfig/network-scripts/ifcfg-enp0s25
DEVICE=enp0s25        ##设备名称
ONBOOT=yes        ##开启服务设备自动激活
BOOTPROTO=none        ##网卡工作状态
BRIDGE=br0        ##网卡开启的网桥接口
vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.6
NETMASK=255.255.255.0
TYPE=Bridge        ##网络接口类型是桥接

systemctl stop NetworkManager.service
systemctl restart network
systemctl start NetworkManager.service
[root@foundation6 network-scripts]# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.25.254.6  netmask 255.255.255.0  broadcast 172.25.254.255
        inet6 fe80::221:ccff:fe71:13d0  prefixlen 64  scopeid 0x20<link>
        ether 00:21:cc:71:13:d0  txqueuelen 0  (Ethernet)
        RX packets 58  bytes 6962 (6.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 25  bytes 3421 (3.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
命令管理方式
添加
systemctl stop NetworkManger
brctl show        ##显示桥接的设备
brctl addbr br0        ##添加桥接设备
brctl addif br0 eth0    ##将网卡加入桥接设备
ifconfig eth0 up
ifconfig br0 172.25.254.x netmask 255.255.255.0    ##添加ip地址
brctl show
ping 172.25.254.250    ##测试结果
删除
ifconfig br0 down
brctl delif br0 eth0
brctl delbr br0

brctl show


#########ipv6########

1.
internet proto version 6
ipv4 32/2         ##地址枯竭 子网掩码24 16 8
ipv6 128/2        ##子网掩码16 32 48 64 80
128/2----------------> 128/8  16  -----> 0-f
2017:0:0:0:f:0:0:1/48    ##
2017::f:0:0:1        ##
2017:0:0:0:f::1        ##代表相同的网络(::代表省略中间的0,只能使用一次)

2.IPV6的设置

vim /etc/sysconfig/network-scripts/ifcfg-eth0

systemctl restart network

测试:
[root@localhost ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.25.254.106  netmask 255.255.255.0  broadcast 172.25.254.255
        inet6 2017::d  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::5054:ff:fe00:60a  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:00:06:0a  txqueuelen 1000  (Ethernet)
        RX packets 11859  bytes 716655 (699.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 651  bytes 34081 (33.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# ping6 2017::a       ##用ping6测试IPV6地址在同一网段结果
PING 2017::a(2017::a) 56 data bytes
64 bytes from 2017::a: icmp_seq=1 ttl=64 time=1.02 ms
64 bytes from 2017::a: icmp_seq=2 ttl=64 time=1.01 ms
64 bytes from 2017::a: icmp_seq=3 ttl=64 time=1.09 ms
^C
--- 2017::a ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.010/1.044/1.099/0.039 ms
[root@localhost ~]#
原创粉丝点击