0
点赞
收藏
分享

微信扫一扫

桥接配置^

新鲜小饼干 2022-01-13 阅读 54

桥接

先把之前配置的team机制的连接删除掉

配置:

1.需要有一个对外的桥接的虚拟的网卡,需要有ip

nmcli c add type bridge con-name br1 ifname br1 ipv4.addresses 192.168.88.220/24 ipv4.gateway 192.168.88.2 ipv4.dns 8.8.8.8 ipv4.method manual 

2.将我们的网卡连接到虚拟桥接网卡上

nmcli c add type bridge-slave con-name br1_port1 ifname ens160 master br1
nmcli c add type bridge-slave con-name br1_port2 ifname ens224 master br1

3.启动

nmcli c up br1_port1
nmcli c up br1_port2
nmcli c up br1

4.测试: 测试我们网卡上面是不是有网桥转发过来的数据包(icmp)

tcpdump icmp -i ens160
tcpdump icmp -i ens224
​
在windows去ping 192.168.233.168 => 默认ping四次
​
那意味着:你在ens224和ens160上面都可以抓到4次icmp request数据包
​
[root@rhce ~]# tcpdump icmp -i ens160
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens160, link-type EN10MB (Ethernet), capture size 262144 bytes
03:43:55.800891 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4593, length 40
03:43:55.800926 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4593, length 40
03:43:56.804002 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4594, length 40
03:43:56.804054 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4594, length 40
03:43:57.810142 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4595, length 40
03:43:57.810175 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4595, length 40
03:43:58.814178 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4596, length 40
03:43:58.814235 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4596, length 40
​
​
[root@rhce ~]# tcpdump icmp -i ens224
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens224, link-type EN10MB (Ethernet), capture size 262144 bytes
03:43:55.800879 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4593, length 40
03:43:55.801544 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4593, length 40
03:43:56.804123 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4594, length 40
03:43:56.804131 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4594, length 40
03:43:57.810130 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4595, length 40
03:43:57.810240 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4595, length 40
03:43:58.814158 IP 192.168.233.1 > rhce: ICMP echo request, id 1, seq 4596, length 40
03:43:58.814361 IP rhce > 192.168.233.1: ICMP echo reply, id 1, seq 4596, length 40
举报

相关推荐

0 条评论