lxc with simple bridge

52 阅读1分钟

wiki.debian.org/LXC

wiki.debian.org/LXC/SimpleB…

# Debian 12
$ apt install lxc

# /etc/network/interfaces
  auto br0
  iface br0 inet static
        address  x.x.x.x/24
        gateway x.x.x.x.x
        bridge-ports enp6s18
        bridge-stp off
        bridge-fd 0

# /etc/default/lxc-net
  USE_LXC_BRIDGE="false"

$ ip link set dev lxcbr0 down
$ brctl delbr lxcbr0
$ brctl show

lxc-create -n d12 -t debian

# /var/lib/lxc/d12/config
  lxc.net.0.link = br0

$ lxc-stop d12
$ lxc-start d12
$ lxc-ls -f