[root@kunpeng82 devuser]# ovs-vsctl add-br s1 [root@kunpeng82 devuser]# ovs-vsctl add-br s2
patch port 说明请看https://arthurchiao.github.io/blog/ovs-deep-dive-4-patch-port/
ovs里的不同bridge之间可以通过patch port进行连接,类似于linux的veth接口。
[root@kunpeng82 devuser]# ovs-vsctl add-port s1 s1_p1 ovs-vsctl: Error detected while setting up 's1_p1': could not open network device s1_p1 (No such device). See ovs-vswitchd log for details. ovs-vsctl: The default log directory is "/var/log/openvswitch". [root@kunpeng82 devuser]# ovs-vsctl add-port s1 s1_p2 ovs-vsctl: Error detected while setting up 's1_p2': could not open network device s1_p2 (No such device). See ovs-vswitchd log for details. ovs-vsctl: The default log directory is "/var/log/openvswitch".
[root@kunpeng82 ovs]# ovs-vsctl add-port s2 s2_p3 ovs-vsctl: Error detected while setting up 's2_p3': could not open network device s2_p3 (No such device). See ovs-vswitchd log for details. ovs-vsctl: The default log directory is "/var/log/openvswitch". [root@kunpeng82 ovs]# ovs-vsctl add-port s2 s2_p4 ovs-vsctl: Error detected while setting up 's2_p4': could not open network device s2_p4 (No such device). See ovs-vswitchd log for details. ovs-vsctl: The default log directory is "/var/log/openvswitch".
[root@kunpeng82 ovs]# ip netns add ns_s1 [root@kunpeng82 ovs]# ip link set s1_p1 netns ns_s1 Cannot find device "s1_p1"
[root@kunpeng82 ovs]# ovs-vsctl set Interface s1_p1 type=internal [root@kunpeng82 ovs]# ip link set s1_p1 netns ns_s1 [root@kunpeng82 ovs]#
[root@kunpeng82 ovs]# ip netns exec ns_s1 ip addr add 192.168.1.103/24 dev s1_p1 [root@kunpeng82 ovs]# ip netns exec ns_s1 ifconfig s1_p1 up [root@kunpeng82 ovs]#
<