[lxc-users] make a nginx webserver in a lxc container available to the local wireless lan

Eldon Kuzhyelil eldon.mec at gmail.com
Wed Dec 9 11:41:20 UTC 2015


Hi,
I have followed that
https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-network and changed my
lxc config file like below

lxc.network.type = veth
lxc.network.link = br0

 and in my /etc/network/interfaces i have followed this link
https://help.ubuntu.com/lts/serverguide/network-configuration.html#bridging

and my interface file looks like this now

auto lo
iface lo inet loopback

auto br0
iface br0 inet static
        address 192.168.0.10(my ip address when connected through ethernet)
        network 192.168.0.0
        netmask 255.255.255.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

Now bring up the bridge:

sudo ifup br0



But after rebooting i am still not able to connect to internet using
ethernet or wifi.
What to do?

I am using kubuntu 14.04 and i have installed nginx in one container
and want that webpage from my lxc container to be visible in another
laptop connected

to my private LAN

Thankyou




On Tue, Dec 8, 2015 at 6:09 PM, Luis Michael Ibarra <
michael.ibarra at gmail.com> wrote:

> Hi all,
>
> 2015-12-04 5:47 GMT-05:00 Eldon Kuzhyelil <eldon.mec at gmail.com>:
>
>> Hi,
>> I am using kubuntu 14.04 with lxc installed on it.I have created one lxc
>> container and installed nginx webserver in that container and created a
>> simple webpage displaying a welcome sentence.I am able to get this page
>> when i enter the http://10.0.1.3 (ip address of the container).Now i
>> want to display this webpage from another machine connected to the same
>> wireless LAN.i have searched the bridgng techniques.But not able to do it.
>> Can anybody help me in this?
>>
>> There you go, just update/delete your iptables rules if container's ip
> changes or you stop using the service.
>
> #echo 1 > /proc/sys/net/ipv4/ip_forward
> #iptables -A FORWARD -j ACCEPT
> #iptables -t nat -A PREROUTING -d ${HOST} -p tcp --dport 80 -j DNAT --to
> ${CONTAINER}:80 -m comment --comment "http to ${CONTAINER}"
>
>
>
>> Thank you
>>
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>>
>
>
>
> --
> Luis Michael Ibarra
>
> _______________________________________________
> 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/20151209/cfffb15b/attachment.html>


More information about the lxc-users mailing list