| Linode Forum https://forum.linode.com/ |
|
| LXC inside linodes with 'visible' (public and private) IPs https://forum.linode.com/viewtopic.php?f=19&t=12359 |
Page 1 of 1 |
| Author: | mrkiMile [ Wed Oct 28, 2015 4:32 pm ] |
| Post subject: | LXC inside linodes with 'visible' (public and private) IPs |
Hello. Is it possible to run LXC inside my linodes in a manner so that I can assign IP addresses that are 'visible' from outside the linode hosting the containers? I have a linode, which has a public IP and private IPs. I have installed lxc packages (I'm using Ubuntu Trusty) and fired up lxc container with default configuration. That works fine. I got lxcbr0 interface on my linode host, I got iptables rules that do NAT for the lxc network (where lxcbr0 is the gateway), and everything works ok. The lxc gets IP from 10.0.3.0/24 network, and can reach internet (I can ping google and so on). Of course, I can't reach lxc from the internet (without doing port forwarding using iptables or some other means). Then Linode gave me another (private) IP for my linode, from 192.168.x.x range. I changed my linode host configuration - I added br0 interface which is bridge for eth0: Code: root@linodehost:~# cat /etc/network/interfaces This is how my routes look: Code: root@linodehost:~# route -n This all works fine, I can access the public ip (176.58.1xx.yyy) of my linode from the internet, and private IP from other linodes. However when I change my lxc confuration so that it uses br0: Code: root@linodehost:~# grep network /var/lib/lxc/ticketshop-dev/config And then configure linode-assigned private IP to the container: Code: root@lxc01:~# cat /etc/network/interfaces I can ping the gateway: Code: root@ticketshop-dev:~# ping 192.168.207.60 But I can't get out: Code: root@ticketshop-dev:~# ping 8.8.8.8 What am I doing wrong? Is such configuration possible on Linode network? I'm assuming that I'm configuring wrong gateway inside my lxc, but I'm not sure what would the proper gateway be? |
|
| Author: | rfeliciano [ Fri Oct 30, 2015 2:05 pm ] |
| Post subject: | Re: LXC inside linodes with 'visible' (public and private) IPs |
You won't be able to get out on the private network, it's private. You need to have this route changed: 0.0.0.0 192.168.207.60 0.0.0.0 UG 0 0 0 eth0 All traffic not within 192.168.203.66/17 network needs to go to the publically addressable gateway, not the private one. Also, I haven't done it yet myself, but if you have Linode Support assign you a /64 IPv6 pool, you can simply give each container its own IPv6 address that they can use. |
|
| Author: | mrkiMile [ Sun Nov 01, 2015 4:20 am ] |
| Post subject: | Re: LXC inside linodes with 'visible' (public and private) IPs |
Yup, that is correct - Linode will need to let me do that. I can get out from the host as that one has public interface. But, what's confusing is that I can't even connect to my other hosts' private IPs. |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|