在创建 LXC 的时候选择了 DHCP ,但是启动完后,eth0 是 DOWN 的状态
[root@arch-template ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if44: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 9a:33:b8:9d:ce:2b brd ff:ff:ff:ff:ff:ff link-netnsid 0
手动 ip link set dev eth0 up
后,也没有自动获取网络配置。
LXC 模板用的 archlinux 。
[root@arch-template ~]# systemctl status NetworkManager.service
× NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/NetworkManager.service.d
└─NetworkManager-ovs.conf
Active: failed (Result: exit-code) since Sat 2022-01-08 13:34:24 UTC; 11s ago
Docs: man:NetworkManager(8)
Process: 126 ExecStart=/usr/bin/NetworkManager --no-daemon (code=exited, status=226/NAMESPACE)
Main PID: 126 (code=exited, status=226/NAMESPACE)
CPU: 839us
Jan 08 13:34:24 arch-template systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Jan 08 13:34:24 arch-template systemd[1]: Failed to start Network Manager.
Jan 08 13:34:24 arch-template systemd[1]: NetworkManager.service: Scheduled restart job, restart coun>
Jan 08 13:34:24 arch-template systemd[1]: Stopped Network Manager.
Jan 08 13:34:24 arch-template systemd[1]: NetworkManager.service: Start request repeated too quickly.
Jan 08 13:34:24 arch-template systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Jan 08 13:34:24 arch-template systemd[1]: Failed to start Network Manager.
Jan 08 13:34:30 arch-template systemd[1]: NetworkManager.service: Start request repeated too quickly.
Jan 08 13:34:30 arch-template systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Jan 08 13:34:30 arch-template systemd[1]: Failed to start Network Manager.
请大家帮忙看下,谢谢
1
ACEonly 2022-01-09 10:21:58 +08:00
分配的網卡是虛擬 vmbr 還是直通?
lxc/xxx.conf 改過了沒,例如 lxc.net.type:phys ? |
2
moonsn OP @ACEonly 网卡 vmbr ,启动时因为 apparmor 的限制,systemd-network 有些操作权限不允许(没太细看)。最终失败了。我直接改成无特权容器就没啥问题了。
|
3
fhbyljj 2022-01-10 11:01:22 +08:00 via Android
不要设置为特权容易
|
4
fhbyljj 2022-01-10 11:01:29 +08:00 via Android
容器
|
5
phrnet 2022-01-12 01:04:31 +08:00
分配网卡没
|