IPv6和高级网络协议

来源:互联网 发布:itouch4怎么下载软件 编辑:程序博客网 时间:2024/06/06 12:56
#######IPv6#######
称为IPv4的下一代协议

为方便操作, 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

ping6 2001:db8:0:1::1
• tracepath6 2001:db8:0:2::451
• netstat -46n
– n
– t
– u
– L
– a
– p
不作解析
tcp 协议
udp 协议
状态位 listen 的端口
所有端口
显示进程


nmcli connection add con-name eth0
ifname eth0 type ethernet ip6 2014::1 gw6
2014::5
– ip addr show
– ip -6 route
#######高级网络设置##########
##bridge##
首先把真机里面的ifcfg-br0  ifcfg-enp0s25移到/mnt下面再开始做实验
nm-con***
把以太网和桥接删掉
然后编辑文件
ifcfg-enp0s25
DEVICE=enp0s25                
ONBOOT=yes
BOOTPROTO=none
BRIDGE=br0                ##网桥

vim ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
TYPE=Bridge                ##类型B大写
IPADDR=172.25.254.39
PREFIX=24
DNS1=172.25.254.250

systemctl stop NetworkManager.service
systemctl restart network
systemctl start NetworkManager


#######对网桥的管理######
nm-co***        ##先删除网卡
brctl addbr br0        ##添加网桥
brctl show        ##显示网桥
brctl addif br0 eth0    ##把br0搭在eth0上面
ifconfig br0 172.25.254.139netmask 255.255.255.0    ##对网桥进行配置
ping 172.25.254.250        ##可以ping通
brctl delif br0 eth0        ##把br0从eth0上面移除
然后ping 172.25.254.250
ifconfig br0 down           ##把br0ifconfig中移除
brctl delbr br0            ##删除网桥

#######bonding#######
如果有一块网卡坏掉的时候该怎么办,现在有网卡的bonding技术

首先需要两块网卡,我们在虚拟机里面添加一块网卡
然后我们开始搭建bond
nmcli connetction add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.139/24        ##添加bond名字为bond0
然后我们打开两个shell 一个监控bond  一个ping 172.25.254.250
watch -n -1 cat /proc/net/bonding/bond0
然后我们把两块网卡添加到bond0上面
nmcli connetcion add con-name eth0 ifname eth0 type bond-slave master bond0
nmcli connetcion add con-name eth1 ifname eth1 type bond-slave master bond0

分别把两块网卡添加上去

然后我们在监控bond里面可以看见是先添加上去的eth0在工作
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 52:54:00:00:0e:0a
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 52:54:00:77:c2:ad
Slave queue ID: 0

如果ifconfig eth0 down          ##把eth0网卡down掉

ifconfig eth0 up            ##up


#######team######## team类新的最多可以挂8个网卡  bond只能挂两个
在做这些之前我们要把刚才做的bond删掉
nmcli connetcion delete eth0
nmcli connetcion delete eth1
nmcli connetcion delete bond0
nmcli connetcion add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.114/24        ##添加team名为team0
 
分别把eth0和eth1添加到team0中
nmcli connetcion add con-name eth0 type team-slave ifname eth0 master team0
nmcli connetcion add con-name eth1 type team-slave ifname eth1 master team0

监控team的命令:watch -n 1 teamdctl team0 stat
0 0