[lxc-users] network.type vlan: unable to get it working

Andrey Repin anrdaemon at yandex.ru
Fri May 1 00:23:45 UTC 2015


Greetings, LXC users mailing-list!

> 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.

Do you ACTUALLY have a router supporting VLAN's ?

> 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

Even better, you are trying to create VLAN over WiFi...
I have a doubt you understand what you are doing.

> 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

You're missing the point. Like, totally.
VLAN's are used to ISOLATE, not CONNECT.

> 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!

Using wrong tools to solve your issue. Apparently.

Start from the beginning, state your goal without trying to declare a
solution.


-- 
With best regards,
Andrey Repin
Friday, May 1, 2015 03:19:23

Sorry for my terrible english...



More information about the lxc-users mailing list