You are not logged in.
I am following the shared inet page on the lxc wiki to get my container to have a network but when I start the bridge I made, my host machine loses its internet.
The hosts's netctl profile:
Description='A basic static ethernet connection using iproute'
Interface=eno1
Connection=ethernet
IP=static
Address='192.168.0.2/24'
Gateway='192.168.0.1'
DNS=('192.168.0.1')
The hosts's bridge profile:
Description="lxc bridge"
Interface=br0
Connection=bridge
BindsToInterfaces=(eno1)
IP=static
Address='192.168.0.3/24'
SkipForwardingDelay=yes
So I boot the host and the network is up just fine, but when I start the bridge with "netctl start lxcbridge" I can't ping anything from the host.
Last edited by maggie (2015-04-19 21:31:34)
Offline
You need to point the IP of the bridge to the host's and also include the gateway and dns.
Example from my system:
---BRIDGE---
Description="lxc bridge"
Interface=br0
Connection=bridge
BindsToInterfaces=(eno1)
IP=static
Address=10.1.10.200/24
Gateway=10.1.10.1
DNS=10.1.10.1
SkipForwardingDelay=yes
Note that you do not enable both the 'host' profile and the 'bridge' profile. You only enable the 'bridge' profile.
The next step is your container config:
---/var/lib/lxc/playtime/config---
lxc.rootfs = /var/lib/lxc/playtime/rootfs
lxc.utsname = playtime
lxc.arch = x86_64
lxc.include = /usr/share/lxc/config/archlinux.common.conf
# network
lxc.network.type = veth
lxc.network.link = br0
lxc.network.flags=up
lxc.network.ipv4 = 10.1.10.202/24
lxc.network.ipv4.gateway=10.1.10.1
lxc.network.name = eth0
Don't forget to:
sudo sysctl net.ipv4.ip_forward=1 ; sudo sysctl net.ipv6.conf.default.forwarding=1 ; sudo sysctl net.ipv6.conf.all.forwarding=1
sudo iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE
Last edited by graysky (2015-04-19 18:48:53)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Thank you but it is still not working.
Offline
I edited my first post:
Note that you do not enable both the 'host' profile and the 'bridge' profile. You only enable the 'bridge' profile.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
The wiki did not say that. TY, it works now.
Offline