[lxc-users] network.type vlan: unable to get it working
Bhishma Prasad
bhishma.prasad.s at gmail.com
Thu Apr 30 20:13:52 UTC 2015
Hi,
I'm trying to set up my container to use VLAN for networking. I'm new
to both LXC and VLANs, so please bear with me, thanks! I setup VLAN as
described below, but I still cannot connect to the Internet from
within container. I think I'm missing something very basic, but can't
tell what.
I'm running a Debian Wheezy container in unprivileged mode (on bare
metal host running Debian Jessie).
I followed the example in [1], so my default.conf looks like this:
lxc.network.type = vlan
lxc.network.vlan.id = 10
lxc.network.flags = up
lxc.network.link = wlan0
lxc.network.hwaddr = 00:26:82:5b:61:95
lxc.network.ipv4 = 192.168.43.20/24
I chose the above values so that the above settings are similar to
that of host. That is, the host is also
connected to the Internet via wlan0, host's IP address is 192.168.43.240
I created a VLAN on the host and moved it to container's namespace
host# ip link add link wlan0 name wlan0.10 type vlan id 10
host# ip link set wlan0.10 netns 9962
Now I can see that the interface is visible within the container. I
assigned IP address and default route as well.
container# ip link show wlan0.10
5: wlan0.10 at if3: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
link/ether 00:26:82:5b:61:95 brd ff:ff:ff:ff:ff:ff
container# ip addr add 192.168.43.20/24 brd 192.168.43.255 dev wlan0.10
container# ip link set dev wlan0.10 up
container# ip route add default via 192.168.43.1 dev wlan0.10
container# apt-get update
0% [Connecting to http.debian.net] [Connecting to security.debian.org]^C
As you can see, apt-get update fails as it waits forever to connect to
the Internet.
What am I doing wrong ? Thanks in advance!
[1]: /usr/share/doc/lxc/examples/lxc-vlan.conf
More information about the lxc-users
mailing list