rpm -ivh https://www.rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/bridge-utils-1.5-9.el7.x86_64.rpm
232 brctl
233 brctl show
234 brctl add br0
235 yum -y
236 brctl addbr br0
237 ip link set dev veth0 master br0
238 brctl addif br0 veth0
239 bridge link
240 brctl show
241 ping -c 1 -I veth0 1.2.3.10
242 ping -c 1 -I veth0 1.2.3.102
243 ip a
244 brctl delif br0 veth0
245 ping -c 1 -I veth0 1.2.3.102
246 ping -c 1 -I veth1 1.2.3.102
247 brctl
248 brctl hsow
249 brctl ssow
250 brctl show
251 ip a
252 ip a del 1.2.3.101 dev veth0
253 ip a
254 ip a add 1.2.3.101/24 dev veth0
255 ip a del 1.2.3.102 dev veth1
256 ip a add 1.2.3.102/24 dev veth1
257 ping -c 1 -I veth1 1.2.3.102
258 brctl addif br0 veth0
259 ping -c 1 -I veth1 1.2.3.102
260 ping -c 1 -I veth0 1.2.3.102
261 brctl delif br0 veth0
262 ping -c 1 -I veth0 1.2.3.102
263 ping -c 1 -I veth2 1.2.3.102
264 ping -c 1 -I veth0 1.2.3.102
265 brctl delif br0 veth0
266 ip a add 1.2.3.102/24 dev veth1 scope global
267 ip a del 1.2.3.102/24 dev veth1
268 ip a add 1.2.3.102/24 dev veth1 scope global
269 ip a del 1.2.3.101/24 dev veth0 scope global
270 ip a add 1.2.3.101/24 dev veth0 scope global
271 ping -c 1 -I veth0 1.2.3.102
272 ip a
273 ip link set veth0 up
274 ip link set veth1 up
275 ping -c 1 -I veth0 1.2.3.102
276 ifconfig veth0 up
277 ifconfig veth1 up
278 ping -c 1 -I veth0 1.2.3.102
279 ping -c 1 -I veth0 1.2.3.101
280 ping -c 1 -I veth0 1.2.3.102
281 getenforce
282 systemctl firewalld
283 systemctl statusfirewalld
284 systemctl status firewalld
285 less /var/log/messages
286 brctl show
287 arp -n
288 ip a
289 route -n
290 ip neigh
291 ip neigh list
292 ping 1.2.3.101
293 ping 1.2.3.102
294 ip neigh
295 arp -p
296 arp -a
297 brctl addif br0 veth0
298 ip addr del 1.2.3.101/24 dev veth0
299 ip addr add 1.2.3.101/24 dev br0
300 ip a
301 ip link set br0 up
302 ip a
303 ping -c 1 -I veth0 1.2.3.102
304 arp -n
305 ping 1.2.3.101
306 ping 1.2.3.102
307 ip neigh
308 arp -n
309 ethttol -S veth0
310 ethtool -S veth0
311 ip link add veth00 type veth peer name veth11
312 ip add add 10.1.2.101 dev veth00
313 ip add add 10.1.2.102 dev veth11
314 ip link set veth00 up
315 ip link set veth11 up
316 ping -c 1 -I veth00 ping 10.1.2.102
317 ping -c 1 -I veth00 10.1.2.102
318 ip neigh
319 ping 10.1.2.101
320 arp -n
321 fdb
322 ip fdb
323 ip
324 ip madd
325 ip a
326 ip link add veth000 type veth peer name veth111
327 ip add add 192.168.3.253 dev veth000 up
328 ip add add 192.168.3.253 dev veth000
329 ip add add 192.168.3.254 dev veth000
330 ip link set veth111 up
331 ip link set veth000 up
332 ip add add 192.168.3.252 dev veth111
333 ip s
334 ip a
335 ping -c 1 -I veth000 192.168.3.252
336 ping -c 1 -I veth000 192.168.3.254
337 ping -c 1 -I veth000 192.168.3.253
338 ip a
339 arp -n
[root@node43 ~]# arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.3.3 ether 98:3b:8f:13:46:f6 C ens33
192.168.3.2 ether 30:57:14:c5:a3:a8 C ens33
1.2.3.102 (incomplete) veth0
192.168.3.252 (incomplete) veth000
192.168.3.1 ether 44:c7:fc:54:bd:68 C ens33
10.1.2.102 (incomplete) veth00
192.168.3.10 ether 94:fe:22:98:53:05 C ens33
这个实验有问题, 问题发arp的包无法得到 回应
下面的实验是 正确的
ip link add tap1 type veth peer name tap1_peer
ip link add tap2 type veth peer name tap2_peer
ip link add tap3 type veth peer name tap3_peer
ip link add tap4 type veth peer name tap4_peer
ip netns add ns1
ip netns add ns2
ip netns add ns3
ip netns add ns4
ip link set tap1 netns ns1
ip link set tap2 netns ns2
ip link set tap3 netns ns3
ip link set tap4 netns ns4
ip netns help
ip netns list-id
brctl show
brctl addbr br1
brctl show
brctl addif br1 tap1_peer
brctl addif br1 tap2_peer
brctl addif br1 tap3_peer
brctl addif br1 tap4_peer
ip netns exec ns1 ip addr add local 192.168.10.200/24 dev tap1
ip netns exec ns2 ip addr add local 192.168.10.201/24 dev tap1
ip netns exec ns2 ip addr add local 192.168.10.201/24 dev tap2
ip netns exec ns3 ip addr add local 192.168.10.202/24 dev tap3
ip netns exec ns4 ip addr add local 192.168.10.203/24 dev tap4
ip link set br1 up
ip link set tap1_peer up
ip link set tap2_peer up
ip link set tap3_peer up
ip link set tap4_peer up
ip netns exec ns1 ip link set tap1 up
ip netns exec ns2 ip link set tap2 up
ip netns exec ns3 ip link set tap3 up
ip netns exec ns4 ip link set tap4 up
ip netns exec ns1 ping 192.168.10.201
ip netns exec ns1 ping 192.168.10.202
ip netns exec ns1 ping 192.168.10.203
ip netns exec ns1 ping 192.168.10.204
arp -a
ip netns ns1 arp -a
ip netns ns1 exec arp -a (error)
ip netns help
ip netns exec ns1 arp -a
上面 这一段实验并没有把 ip 让给 br1,跟 之前的用意有区别
是不是需要 做这个

