########高级网络配置#####
#bond#
1.定义####team####
1.Team也是链路聚合的一中方式Team 和 bond0 功能类似
Team 不需要手动加载相应内核模块
Team 有更强的拓展性
Team 支持 8 快网卡
支持模式:广播————broadcast
轮询————roundrobin
主备————activebackup
负载均衡—————loadbalance
2.配置
[root@localhost Desktop]# nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.134/24 ##添加team0
Connection 'team0' (1c2decc3-275b-4ddc-883d-e9fbf895fcb4) successfully added.
[root@localhost Desktop]# nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
Connection 'eth0' (39c97abe-ad65-4755-95c4-54dee5368dcf) successfully added.
[root@localhost Desktop]# nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
Connection 'eth1' (8411287f-9f9d-4b36-9ec9-1d01f179fb5c) successfully added.
[root@localhost Desktop]# watch -n 1 teamdctl team0 stat ##查看team的状态
[root@localhost Desktop]# ifconfig eth0 down
[root@localhost Desktop]# ifconfig eth0 up
[root@localhost Desktop]# ifconfig eth1 dow
#####网桥###
1.网络桥接
网络桥接用网络桥实现共享上网主机和客户机除了利用软件外,还可以用系统自带的网络桥建立连接用双网卡的机器做主机
2.网络桥接的管理命令
• brctl ### 桥接管理命令
– show ### 显示
– addbr ### 添加网桥
– delbr ### 删除网桥
– addif ### 添加网桥连接
– delif ### 删除网桥连接
3.配置方式
[root@foundation66 ~]#cd /etc/sysconfig/network-scripts/
[root@foundation66 network-scripts]# vim ifcfg-enp7s0f1
DEVICE=enp7s0f1 ##设备名称
ONBOOT=yes ##开启服务设备自动激活
BOOTPROTO=none ##网卡工作状态
BRIDGE=br0 ##网卡开启的网桥连接
[root@foundation66 network-scripts]# vim ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.66
NETMASK=255.255.255.0
TYPE=Bridge ##网络接口类型是桥接
[root@foundation66 network-scripts]# ls
ifcfg-br0 ifdown-post ifup-eth ifup-sit
ifcfg-enp7s0f1 ifdown-ppp ifup-ib ifup-Team
ifcfg-lo ifdown-routes ifup-ippp ifup-TeamPort
ifdown ifdown-sit ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-Team ifup-isdn ifup-wireless
ifdown-eth ifdown-TeamPort ifup-plip init.ipv6-global
ifdown-ib ifdown-tunnel ifup-plusb network-functions
ifdown-ippp ifup ifup-post network-functions-ipv6
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes
[root@foundation66 network-scripts]# systemctl stop NetworkManager.service
[root@foundation66 network-scripts]# systemctl restart network
[root@foundation66 network-scripts]# systemctl start NetworkManager.service
4.命令管理方式
添加
[root@localhost Desktop]# nmcli connection show
NAME UUID TYPE DEVICE
[root@localhost Desktop]# brctl addbr br0 ##添加网桥
[root@localhost Desktop]# brctl show ##显示网桥
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
[root@localhost Desktop]# ifconfig br0 172.25.254.134 netmask 255.255.255.0 ##设置网桥ip和网关
[root@localhost Desktop]# brctl addif br0 eth0 ##添加网桥连接
[root@localhost Desktop]# ifconfig eth0 up ##eth0工作
[root@localhost Desktop]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.52540000420a no eth0
[root@localhost Desktop]# ping 172.25.254.66 ##添加成功
PING 172.25.254.66 (172.25.254.66) 56(84) bytes of data.
64 bytes from 172.25.254.66: icmp_seq=1 ttl=64 time=0.181 ms
64 bytes from 172.25.254.66: icmp_seq=2 ttl=64 time=0.146 ms
^C
--- 172.25.254.66 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.146/0.163/0.181/0.021 ms
删除
[root@localhost Desktop]# ifconfig br0 down [root@localhost Desktop]# brctl delif br0 eth0
[root@localhost Desktop]# brctl delbr br0
[root@localhost Desktop]# brctl show
bridge name bridge id STP enabled interfaces
#####IPv6 #####
1.简介
Internet Protocol Version 6
IPv6 是 IETF (和互联网工程任务组)设计的用与替代现行版本 IP 协议的下一代 IP 协议。
IPv6 采用 128 位 2 进制数码表示
2.IPv6 表示方式
为方便操作, ipv6 被换算成 8x16 进制的一串数字
– 2000:0000:0000:0000:0000:0000:0000:0001
– 2000:0:0:0:0:0:0:1
任意位数的 0 可以用 :: 来表示
– 2000:0000:0000:0000:0000:0000:0000:0001
– 2000::1
3.检测 IPv6 网络的工具
• ping6 2001:db8:0:1::1
• tracepath6 2001:db8:0:2::451
• netstat -46n
– n 不作解析
– t tcp 协议
– u udp 协议
– L 状态位 listen 的端口
– a 所有端口
– p 显示进程
4.ipv6的配置
[root@localhost Desktop]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# vim ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.134
NETMASK=255.255.255.0
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=2017::1/24
[root@localhost network-scripts]# systemctl restart network
[root@localhost network-scripts]# ifconfig
[root@localhost network-scripts]#ping6 2017::1