我想在兩個不同的名字空間通過網橋實作通信(linux版本:ubuntu16.04)
我的步驟如下:
1.創建了2個名字空間ns1和ns2
1.在linux上創建了兩個veth對(tap1<-->br-tap1 和 tap2<-->br-tap2),同時創建了一個網橋
2.把br-tap1、br-tap2配置成網橋的埠
3.把tap1配置到ns1; 把tap2配置到ns2
配置網路圖 如下:

我想實作tap1和tap2的互ping,但是怎么都ping不通,請教一下高手這是怎么回事啊?
附,我的配置腳本如下:
# 創建名字空間和網橋
BRIDGE=brTest
ip netns add ns1
ip netns add ns2
brctl addbr $BRIDGE
brctl stp $BRIDGE off
ip link set dev $BRIDGE up
#
#
#
#
# 創建埠
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 netns exec ns2 ip link set dev tap2 up
ip netns exec ns2 ipconfig tap2 192.168.200.2/24 up
ip link set dev br-tap2 up
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/14426.html
標籤:系統維護與使用區
下一篇:運行出錯但gdb除錯不出錯?
