Home > OS >  Ask people about a different namespace ping each other
Ask people about a different namespace ping each other

Time:11-12

I think in two different name space realize communication through the bridge (the Linux version: ubuntu16.04)
My steps is as follows:
1. Create 2 ns1 name space and the ns2
1. On Linux creates two veth for (tap1 & lt; --> Br - tap1 and tap2 & lt; --> Br - tap2), at the same time created a bridge
2. The br - tap1, br - tap2 configured to bridge port
3. Tap1 configuration to ns1; Tap2 configuration to the ns2
Configure the network diagram is as follows:


I want to achieve mutual ping tap1 and tap2, but how all can't, ask ace this is how to return a responsibility?

Attached, my configuration script is as follows:

# to create namespace and bridge
BRIDGE=brTest
IP netns add ns1
IP netns add ns2
BRCTL addbr $BRIDGE,
BRCTL STP $BRIDGE off
IP link set dev $BRIDGE up
#
#
#
#
# to create port
IP link add tap1 type veth peer name br - tap1
BRCTL addif $BRIDGE, br - tap1
IP link set tap1 netns ns1
IP netns exec ns1 IP link set dev tap1 up
IP netns exec ns1 ipconfig tap1 192.168.200.1/24 up
IP link set dev br - tap1 up
#
IP link add tap2 type veth peer name br - tap2
BRCTL addif $BRIDGE, br - tap2
IP link set tap2 netns ns2
IP link set IP netns exec ns2 dev tap2 up
IP netns exec ns2 ipconfig tap2 192.168.200.2/24 up
IP link set dev br - tap2 up
  • Related