[lxc-users] Ubuntu container IP address

Luis Michael Ibarra michael.ibarra at gmail.com
Fri Nov 20 01:02:46 UTC 2015


typo. I meant to expose a container.

> In summary:
> 1. If you are using a bridge not associated with a host interface(nic)
and you want to expose a CONTAINER:
>
> - Only configure NAT on the host.
>
> 2. If you want to connect a host interface to the bridge having
communication with the host network(your router and other devices connected
to this segment) <if you don't follow read about subnetting>:
>
> - You have to  do a few things:
> a. Configure the host bridge for the local network (router segment).
> b. Assign this bridge to the container config. More info man
lxc.container.conf.
> c. Configure an ip address to the container, you could do this by the
config file for the container or inside the container. Again man
lxc.container.conf
>
> Search in the mailing list because this issue has been solved a few times
already.
>
> Greetings,
>
> [1] https://www.flockport.com/lxc-networking-guide/.
>
> >
> > On Thu, Nov 19, 2015 at 2:43 PM, Fajar A. Nugraha <list at fajar.net>
wrote:
> >>
> >> On Fri, Nov 20, 2015 at 5:04 AM, Robert Koretsky <bobk48 at gmail.com>
wrote:
> >>>
> >>> Guido et al:
> >>> Another suggestion I got from the Ubuntu Forums on virtualisation
gave me a single line that could be added to the iptables configuration(
and also some other alternate ways of using and configuring ufw) to achieve
a "port forwarding" of a port of interest, like 22, to the container IP
10.0.3.1 from my host IP 192.168.0.6. I am going to try this one-line
iptables method, see if it works. More importantly, once my container can
be ssh'ed to from my home network, will my host still be reachable. Other
than that, I'm not sure what else to do.
> >>
> >>
> >> How about reading replies of your mail in the other thread you created?
> >>
> >> I'm going to assume it's because somehow you didn't get the replies in
your inbox, so I CC your mail as well here.
> >>
> >>>
> >>> Believe me, other suggested solutions were either 100-line long bash
scripts plus dozens of changes and package downloads, or were completely
off base.
> >>
> >>
> >> You obviously haven't read Ubuntu's lxc documentation. Nor Ubuntu's
network bridge documentation (
https://help.ubuntu.com/lts/serverguide/network-configuration.html#bridging),
which is also linked on lxc documentation page.
> >>
> >> It's NOT 100-line long script. And the required bridge packages is
already installed when you install lxc.
> >>
> >>> Again, can anyone tell me why lxcbr0 is configured to start with an
IP of 10.0.3.1?
> >>
> >>
> >> The same reason why virtualbox uses NAT networking for VMs by default.
> >>
> >>>
> >>> My Ubuntu 15.10 Desktop machine, which has a container, gets its IP
via DHCP from a router.
> >>
> >>
> >> Assuming you've read the docs, bridging should work.
> >>
> >> The exception is if your desktop connects to LAN via wifi, in which
case bridging will NOT work.
> >>
> >> --
> >> Fajar
> >
> >
> >
> > _______________________________________________
> > lxc-users mailing list
> > lxc-users at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151119/49d71a94/attachment.html>


More information about the lxc-users mailing list