跨机器访问networking名称空间中的tap接口

我希望能够从正在运行的计算机之外的名称空间访问在TAP界面上运行的服务。 我已经安装,看起来像这样 –

VM1/Machine1 +eth0 : Public Network +eth1 : Private Network (IP: 192.168.2.5/24) VM2/Machine2 +========================================+ | | | eth0: Public Network 10.1.1.20/24 UP | | eth1: Private Network UP | |----------------------------------------+ | Network Namespace : test | | TAP0: 192.168.2.10/24, UP | |----------------------------------------| | | +========================================+ 

我希望能够在VM1 / Machine1的命名空间testing下ping /访问运行在TAP0上的服务。 我使用了'命名空间之间的OpenVSwitch'和一些其他在线文章创build桥梁的信息,把'eth1'和'TAP0'放在同一个网桥上。 但我仍然无法访问它。 不知道还有什么失踪? 这是我在VM2 / Machine2上试过的命令 –

 ip netns add test ovs-vsctl add-br br0 ovs-vsctl add-port br0 tap0 -- set interface tap0 type=internal ip link set tap0 netns test ip netns exec test ip addr add 192.168.2.10/24 dev tap0 ip netns exec test ip link set tap0 up ovs-vsctl add-port br0 eth1 -- set interface eth1 type=internal 

之后桥br0有'eth1'和'tap0'。 所以当我ping到来自VM1的tap接口的IP时,我以为我应该能够到达tap0。 这工作正常,没有命名空间,但命名空间不起作用。

又一次尝试,我也试了一下

 - creating 2 bridges - one OVS bridge outside - one linux bridge inside namespace - created a veth pair - ovs bridge has eth1 and one end of veth pair - linux bridge in the namespace has 'tap' interface and other end of veth pair 

但是,这也没有工作:(

我认为桥接的关键是如果我添加接口/端口,我必须能够访问端口上的服务,就像一个开关。 我不知道我缺less什么。