Answer the question
In order to leave comments, you need to log in
How to set up networking for lxc on CentOS 7?
Help setting up mesh for lxc containers in CentOS 7.
installed bridge-utils
added interface
DEVICE=virbr0
TYPE=Bridge
BOOTPROTO=none
IPADDR=10.10.0.1
NETMASK=255.255.255.0
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
restarted mesh
bridge visible in the list , but containers don't see the world (
Answer the question
In order to leave comments, you need to log in
IPADDR=10.10.0.1
If you need to set up a bridged network (without NAT), then you can do this (however, I write for debian-based).
in the container settings (located in /var/lib/lxc/$NAME/) write:
lxc.network.flags = up
lxc.network.link = virbr0
lxc.network.veth.pair = veth0
lxc.network.ipv4 = 10.10. 0.2/24
lxc.network.ipv4.gateway = 10.10.0.1
add to bridge settings:
bridge_fd 0
bridge_maxage 0
add route:
route add -host 10.10.0.2 dev virbr0
forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
check whether filtering is enabled in /proc/sys/net/bridge/bridge-nf*
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question