I am following this tutorialhttps://docs.docker.com/articles/networking/#between-containersI have used following commands$ sudo brctl addbr bridge0$ sudo ip addr add 192.168.0.160/24 dev bridge0$ sudo ip link set dev bridge0 up# Confirming that our bridge is up and running$ ip addr show bridge04: bridge0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state UP group default    link/ether 66:38:d0:0d:76:18 brd ff:ff:ff:ff:ff:ff    inet 192.168.0.160/24 scope global bridge0       valid_lft forever preferred_lft forever# Tell Docker about it and restart (on Ubuntu)$ echo 'DOCKER_OPTS=-b=bridge0' >> /etc/default/docker$ sudo service docker startIt looks to work fine as i can see that my all conatiner are getting ip in that range.Now as i have 3 conatinersmysql 192.168.0.3redis 192.168.0.5webserver 192.168.0.6Now if i ping redis from webserver it worksbut i cma not able to ping the host 192.168.0.160 it says destination host unrecableINFOvagrant@ubuntu-docker-base:/mydocker/containers$ brctl showbridge name bridge id       STP enabled interfacesbridge0  8000.7e8945d   no  veth1a8b959                            veth404a3b2                            veth7959157docker0     8000.5689799    nocontainerroot@286329032cd5:/# ip routedefault via 192.168.0.160 dev eth0192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.5root@286329032cd5:/# ping 192.168.0.3PING 192.168.0.3 (192.168.0.3) 56(84) bytes of data.64 bytes from 192.168.0.3: icmp_seq=1 ttl=64 time=0.125 ms64 bytes from 192.168.0.3: icmp_seq=2 ttl=64 time=0.130 ms64 bytes from 192.168.0.3: icmp_seq=3 ttl=64 time=0.072 ms^C--- 192.168.0.3 ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 1998msrtt min/avg/max/mdev = 0.072/0.109/0.130/0.026 msroot@286329032cd5:/# ping 192.168.0.160PING 192.168.0.160 (192.168.0.160) 56(84) bytes of data.From 192.168.0.5 icmp_seq=1 Destination Host UnreachableFrom 192.168.0.5 icmp_seq=2 Destination Host UnreachableFrom 192.168.0.5 icmp_seq=3 Destination Host Unreachable^C--- 192.168.0.160 ping statistics ---6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5032mspipe 3root@286329032cd5:/#
Docker container not able to ping host
linux;ubuntu;docker;containers