подключение 4 пространств имен через ovs bridge

Я хотел бы спросить, как я могу подключить 4 пространства имен к одному ovs brdige, все они находятся на одном хосте. Я попробовал 2 пары veth для этих 4 пространств имен и добавить внутренний порт в мост, но пространство имен может быть пинговано только с другого конца veth.

[root@centos7 ~]# ovs-vsctl show
689941bc-760e-451e-a91c-ddc33caf2396
Bridge brtest
    Port "test1"
        tag: 9
        Interface "test1"
            type: internal
    Port "test4"
        tag: 9
        Interface "test4"
            type: internal
    Port "test2"
        tag: 9
        Interface "test2"
            type: internal
    Port brtest
        Interface brtest
            type: internal
    Port "test3"
        tag: 9
        Interface "test3"
            type: internal
ovs_version: "2.7.0"

ip netns exec nstest1 ifconfig test1 promisc
ip netns exec nstest2 ifconfig test2 promisc
ip netns exec nstest3 ifconfig test3 promisc
ip netns exec nstest4 ifconfig test4 promisc

Я включил promisc для veth пространства имен, и назначил ip от 172.24.0.11 до 172.24.0.14 соответственно. Но только nstest1 может достучаться до nstest2 и nstest3 до nstest4 , потому что nstest1 и nstest2 соединены парой veth и nstest3 и nstest4 соединены другой парой veth .

Могу ли я получить их полностью для этих 4 пространств имен ?

0
25.05.2017, 12:03
1 ответ

Я получил свой ответ, просто создайте пару veth для этих 4 пространств имен, и один конец назначьте пространству имен, а другой добавьте к виртуальному мосту в качестве порта. Тогда эти 4 пространства имен могут быть сквозными из любого из них

ip link set test1a netns nstest1
ip link set test2a netns nstest2
ip link set test3a netns nstest3
ip link set test4a netns nstest4
ovs-vsctl br-list
ovs-vsctl list-br
ovs-vsctl show
ovs-vsctl add-br br0
ovs-vsctl add-port br0 test1b
ovs-vsctl add-port br0 test2b
ovs-vsctl add-port br0 test3b
ovs-vsctl add-port br0 test4b
ip netns exec nstest1 ifconfig test1a 172.24.0.11/24 promisc up
ip netns exec nstest2 ifconfig test2a 172.24.0.12/24 promisc up
ip netns exec nstest3 ifconfig test3a 172.24.0.13/24 promisc up
ip netns exec nstest4 ifconfig test4a 172.24.0.14/24 promisc up

ip link set dev test2b up
ip link set dev test1b up
ip link set dev test3b up
ip link set dev test4b up
0
28.01.2020, 04:45

Теги

Похожие вопросы