[lxc-users] Unable to connect to internet from LXC container

István Király LaKing at D250.hu
Wed Jan 22 03:01:46 UTC 2014


Hello Ibha, ...

To me it seems, that you have a private address for your container,
10.x.x.x, and you connect the network over a bridge interface.

if you are using bridging, you need a separate public-IP for your
container(s).
If you want to connect to the internet over a single public IP (the IP of
your eth0 I assume) you will need to set up IP-mascarading or NAT, or a
reverse proxy, to translate communication between your virtual LAN, and the
internet.
Depending on your needs, you might have also the option to use IPv6, the
above is for classic IPv4.

Greetings, ..


On Tue, Jan 21, 2014 at 7:26 PM, Gandhi, Ibha (HP Software) <ibhag at hp.com>wrote:

>  Hi,
>
>
>
> I am new to LXC and networking in Ubuntu and need help urgently.
>
> I am able to ping the container from the host and vice versa.
>
> The host can connect to internet but the container cannot.
>
> I pinged gateway from container but that also doesn’t work.
>
>
>
> However, output of route –n from the container is:
>
> ubuntu at root-local-machine-2:~$ route -n
>
> Kernel IP routing table
>
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
>
> 0.0.0.0               10.x.x.x            0.0.0.0              UG
> 100    0        0 eth0
>
> 10.x.x.x            0.0.0.0               255.255.x.x     U
>      0      0        0 eth0
>
>
>
> From the host:
>
> eth0      Link encap:Ethernet  HWaddr 00:50:56:9c:24:d5
>
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>
>           RX packets:268433 errors:0 dropped:1103 overruns:0 frame:0
>
>           TX packets:37678 errors:0 dropped:0 overruns:0 carrier:0
>
>           collisions:0 txqueuelen:1000
>
>           RX bytes:29370538 (29.3 MB)  TX bytes:2921285 (2.9 MB)
>
>
>
> lo        Link encap:Local Loopback
>
>           inet addr:127.0.0.1  Mask:255.0.0.0
>
>           inet6 addr: ::1/128 Scope:Host
>
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>
>           RX packets:1957142 errors:0 dropped:0 overruns:0 frame:0
>
>           TX packets:1957142 errors:0 dropped:0 overruns:0 carrier:0
>
>           collisions:0 txqueuelen:0
>
>           RX bytes:523335220 (523.3 MB)  TX bytes:523335220 (523.3 MB)
>
>
>
> lxcbr0    Link encap:Ethernet  HWaddr 00:50:56:9c:24:d5
>
>           inet addr:10.x.x.x  Bcast:10.x.x.x  Mask:255.x.x.x
>
>           inet6 addr: fe80::250:56ff:fe9c:24d5/64 Scope:Link
>
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>
>           RX packets:1458768 errors:0 dropped:179 overruns:0 frame:0
>
>           TX packets:767080 errors:0 dropped:0 overruns:0 carrier:0
>
>           collisions:0 txqueuelen:0
>
>           RX bytes:226231989 (226.2 MB)  TX bytes:127523082 (127.5 MB)
>
>
>
> vethSkshFq Link encap:Ethernet  HWaddr fe:d5:d2:af:33:89
>
>           inet6 addr: fe80::fcd5:d2ff:feaf:3389/64 Scope:Link
>
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>
>           RX packets:616967 errors:0 dropped:0 overruns:0 frame:0
>
>           TX packets:597510 errors:0 dropped:0 overruns:0 carrier:0
>
>           collisions:0 txqueuelen:1000
>
>           RX bytes:112249698 (112.2 MB)  TX bytes:82433706 (82.4
> MB)
>
>
>
> Any help will be appreciated.
>
>
>
> Thanks,
>
> Ibha
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>



-- 
István Király
+36 209 753 758
LaKing at D250.hu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140122/c39aab95/attachment.html>


More information about the lxc-users mailing list