Following instructions I've installed docker on ubuntu 13.04 (and 12.04 + 3.8 kernel), pulled the base container and started a shell inside it. It got a private IP and can ping it's default gateway but can't connect to any host outside, so no apt-get for me.
I have "net.ipv4.conf.all.forwarding = 1" in my sysctl and have POSTROUTING rules in iptables/nat table.
Did the docker installer forgot to add some rules or i'm missing something?
Do you have the MASQUERADE rule?
Can you try to start the daemon with
docker -d -b testbr0
and try again?This will create a new bridge and setup all iptables rules for it.
If it works, it probably mean a
iptables -t nat -F
occurred at some point and the nat rules for docker have been lost. You can either manually recreate them or more easily, remove the docker bridge and restart docker :)Do you use the docker network?
in docker network, you can decide which type of network applies to your container.
even you can make your own network setting
for bridge example can use this command with your own favorite IP range:
after adding that use the
--network
option on thedocker run
command to add a network to your containerbut for your problem, I suggest u use macvlan network on your docker containers Goodluck https://docs.docker.com/network/macvlan/