Network unreachable - Ubuntu lxc container

Hi,
once I create new LXC container (Ubuntu Xen), then start it, then do ping from container’s console, there is “network unreachable”.

In fact ifconfig shows that there is no ipv4 configured, just ipv6.

Shouldn’t it work straight out of the box ? Container template uses veth type and br-lan as bridge to host…

What should I configure to get net access in lxc container (via ipv4) ?

Thank you very much for any help!
John

[Solution] - problem was in disabling DHCP on the router. Once enabled, lxc container gets ipv4 out the box.

guys,
can enyone help me find where is the problem ?
Or how do I setup LXC container with internet connection working ?

Thank you very much for your help.
John

Network should work out of the box. How are you creating that container. I think that creating it using lxc-create won’t create network configuration (I am not sure as I am not the one adding support for it and the on is currently out of the office). Try to do it trough Luci.

Hi cynerd,
thank you very much for reply. I’ve done it through luci directly.

generated config is standard:

Network configuration

lxc.network.type = veth
lxc.network.link = br-lan
lxc.network.flags = up
lxc.network.name = eth0
lxc.network.script.up = /usr/share/lxc/hooks/tx-off
lxc.network.hwaddr = b2:34:dd:7c:bf:e8

if I look in lxc, there is only ipv6 configured and so is on lxc host iface, that is bridged to br-lan. Problem is, that lxc container does not configure ipv4 interface for itself.

Is there any way how to configure lxc to setup ipv4 instead of ipv6 ?

Thank you very much again for any help.
I am enjoying my new turris very much! Great product!

Are you sure that it has ipv6? From configuration you have posted I see that container is connected to lan bridge which means that it should get ip from dhcp. Is it possible that you have no connection and only ip you have is ipv6 from NDP? Can you check configuration in container? Are you sure that you have dhcp client enabled in container?

Thank you very much @cynerd.

Problem was in me disabling DHCP on Turris. Once that was enabled again, it worked out of the box (on ipv4). Problem solved.

Thank you!

Or you could just set static ip in container.