LXC 访客看不到主机 IP。打开 vSwitch 网桥
Host IP is not visible by LXC guests. Open vSwitch bridge
这样我就为 LXC 容器配置了 OVS 桥
是网桥配置:
# ovs-vsctl show
1b236728-4637-42a5-8b81-53d4c93a6803
Bridge "switch0"
Port vethNSCEGY
Interface vethNSCEGY
Port "switch0"
Interface "switch0"
type: internal
Port "vethD6TFEB"
Interface "vethD6TFEB"
ovs_version: "2.3.2"
switch0 是主机上的接口并且具有 IP 192.168.100.1/24
vethNSCEGY 和 vethD6TFEB 是 LXC 来宾的接口。
最终第一个 LXC 来宾 IP 192.168.100.10/24 可以 ping 第二个 LXC 来宾 192.168.100.11/24 但无法 ping 主机IP 192.168.100.1/24
OVS 可以吗?或者我需要 smth 才能启用吗?
PS. 我接口上的 IP:
# ip a
...
4: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
link/ether 52:9d:e1:60:1d:56 brd ff:ff:ff:ff:ff:ff
5: switch0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
link/ether 16:63:eb:47:13:41 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.1/24 scope global switch0
valid_lft forever preferred_lft forever
35: vethNSCEGY: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
link/ether fe:d1:06:81:69:ed brd ff:ff:ff:ff:ff:ff
inet6 fe80::fcd1:6ff:fe81:69ed/64 scope link
valid_lft forever preferred_lft forever
37: vethD6TFEB: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
link/ether fe:ca:e9:16:dd:81 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fcca:e9ff:fe16:dd81/64 scope link
valid_lft forever preferred_lft foreve
又是我的错。 switch0
已关闭。所以打开界面对我有帮助:
# ip link set dev switch0 up
这样我就为 LXC 容器配置了 OVS 桥
是网桥配置:
# ovs-vsctl show
1b236728-4637-42a5-8b81-53d4c93a6803
Bridge "switch0"
Port vethNSCEGY
Interface vethNSCEGY
Port "switch0"
Interface "switch0"
type: internal
Port "vethD6TFEB"
Interface "vethD6TFEB"
ovs_version: "2.3.2"
switch0 是主机上的接口并且具有 IP 192.168.100.1/24 vethNSCEGY 和 vethD6TFEB 是 LXC 来宾的接口。
最终第一个 LXC 来宾 IP 192.168.100.10/24 可以 ping 第二个 LXC 来宾 192.168.100.11/24 但无法 ping 主机IP 192.168.100.1/24
OVS 可以吗?或者我需要 smth 才能启用吗?
PS. 我接口上的 IP:
# ip a
...
4: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
link/ether 52:9d:e1:60:1d:56 brd ff:ff:ff:ff:ff:ff
5: switch0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
link/ether 16:63:eb:47:13:41 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.1/24 scope global switch0
valid_lft forever preferred_lft forever
35: vethNSCEGY: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
link/ether fe:d1:06:81:69:ed brd ff:ff:ff:ff:ff:ff
inet6 fe80::fcd1:6ff:fe81:69ed/64 scope link
valid_lft forever preferred_lft forever
37: vethD6TFEB: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
link/ether fe:ca:e9:16:dd:81 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fcca:e9ff:fe16:dd81/64 scope link
valid_lft forever preferred_lft foreve
又是我的错。 switch0
已关闭。所以打开界面对我有帮助:
# ip link set dev switch0 up