![网际协议网络](https://linux22.com/image/786392/%E7%BD%91%E9%99%85%E5%8D%8F%E8%AE%AE%E7%BD%91%E7%BB%9C.png)
我刚刚学习网络,如果我的问题没有提供所有细节,请原谅,如果需要,我可以提供。
我正在尝试学习 Linux 中的网络命名空间。
我创建了两个命名空间red
和blue
网际协议网络
blue (id: 1)
red (id: 0)
我还创建了一个桥接接口,并将 veth 的一端连接到命名空间,将一端连接到 brdige 接口,如下所示
ip link add v-net-0 type bridge
ip link set dev v-net-0 up
ip link add veth-red type veth peer name veth-red-br
ip link add veth-blue type veth peer name veth-blue-br
ip link set veth-red netns red
ip link set veth-red-br master v-net-0
ip link set veth-blue netns blue
ip link set veth-blue-br master v-net-0
问题是桥接接口没有显示UP状态
ip 链接显示
18: v-net-0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
link/ether 7a:99:f7:ca:7e:f1 brd ff:ff:ff:ff:ff:ff
19: veth-red-br@if20: <BROADCAST,MULTICAST> mtu 1500 qdisc noop master v-net-0 state DOWN mode DEFAULT group default qlen 1000
link/ether e2:ce:34:7b:23:31 brd ff:ff:ff:ff:ff:ff link-netns red
21: veth-blue-br@if22: <BROADCAST,MULTICAST> mtu 1500 qdisc noop master v-net-0 state DOWN mode DEFAULT group default qlen 1000
link/ether 5a:dc:4f:87:63:1a brd ff:ff:ff:ff:ff:ff link-netns blue
将两个 veth 链接到命名空间
ip -n red link set veth-red up
ip -n blue link set veth-blue up
此外,桥梁工具显示禁用状态,而我所关注的文档表明它应该处于forwarding
状态
桥梁链接
19: veth-red-br@if20: <BROADCAST,MULTICAST> mtu 1500 master v-net-0 state disabled priority 32 cost 2
21: veth-blue-br@if22: <BROADCAST,MULTICAST> mtu 1500 master v-net-0 state disabled priority 32 cost 2
感谢帮助。谢谢