Conatiner to container communication

i am newbie to LXC container.i would like to know is there any way to handle communication between two specific container.
If anyone has a clue how to handle this,please let me know.or point me to doc which explaining communication between containers.



There are lots of different networking options available, but it sounds like the simplest for you would be either bridge (which would allow containers to communicate with each other and the host) or macvlan (which would allow containers to communicate with each other and the rest of the network, but not the host).

You would need to create a bridge device first on your host, then you can connect your containers to it.

Take a look at the networking section of the LXC documentation:


Thanks for the quick reply tomp.I have created a bridge device to connect host with containers,so that containers shares host’s network through the bridge and they have unique IP as well.So can you suggest a networking option to handle this??

Hi @sreegin

If you already have a bridge device (and the host’s physical interface is connected to it), then you can connect LXC containers to it using this config: = veth = up = 192.168.0.x/24 = 192.168.0.x = br0

Hi @tomp,
I could tranfer files from host to container using the network,But couldn’t transfer between containers.Is there common memory that can be shared between container without interventions of host.

@sreegin please can you provide the full network config for all containers and the host, along with example ping tests of what works and what doesnt work.


#network configuration = veth = br0 =up
container2:Xenial02,network configuration is same for both.
Host:Raspberry pi.
#network configuration
auto br0
iface br0 inet dhcp
bridge_ports usb0 //Network through usb tethering.
bridge_fd 0
bridge_maxwait 0.
Method used to transfer file from host to container:
scp file.txt ubuntu@ directory (/var/lib/lxc//rootfs/home/<directory