[lxc-users] Ubuntu container IP address

Guido Jäkel G.Jaekel at DNB.DE
Thu Nov 19 22:51:37 UTC 2015


On 19.11.2015 23:04, Robert Koretsky wrote:
> Again, can anyone tell me why lxcbr0 is configured to start with an IP of
> 10.0.3.1? My Ubuntu 15.10 Desktop machine, which has a container, gets its
> IP via DHCP from a router.

"Because" 10.0.0.0/8 is a reserved private network range like 192.168.0.0/16. And there's a good chance, that it is not used outside the machine used by the developer's PC where LXC is typically used.

The other "port forwarding" way you mentioned is comparable to a firewall model, here a selected part of traffic at layer 3 in one network is NATed to another network.

But to clarify again: A IP assigned to the bridge is not related to any Container but to the Host and take over the role of the IP one have assigned to the NIC on the host before it was attached to the bridge.

If you don't attach the bridge to the NIC, the IP on the bridge have to be used as a L3 routing aim. But then, you have to set up a route to the here used network (say 10.0.3/8) on the other hosts or on the router (say to route 10.0.3/8 via 192.168.0.6).


You neither need 100 lines in a script nor I expect that you need to download additional packages (i'm not using Ubuntu) - but you need to understand TCP/IP network basics. And i'm sorry, you'll need it a bit deeper than "I plugged in the cable and the ADSL-router made me connected to the Internet"


BTW: It reads to me, that Fajar gets a bit angry. And It takes some bytes to get him there :o


greetings

Guido



More information about the lxc-users mailing list