Docker container doesn't have any internet access

Viewed 136

After working a long time on why i don't have any internet access into Docker i had to ask here, i read a lot of solutions which posted in this site, my problem don't resolve

what i did before asking here:

1:

pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
sudo service docker restart

2:

OTHER_BRIDGE=br-b0b70e352d8c
service docker stop

ip link set dev $OTHER_BRIDGE down
ip link set dev docker0 down
ip link delete $OTHER_BRIDGE type bridge
ip link delete docker0 type bridge
service docker start && service docker stop

iptables -t nat -A POSTROUTING ! -o docker0 -s 172.17.0.0/16 -j MASQUERADE
iptables -t nat -A POSTROUTING ! -o docker0 -s 172.18.0.0/16 -j MASQUERADE

service docker start

3: stopping iptables and docker daemon:

sudo service iptables stop
sudo service docker restart

4:forwarding rules in iptables:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080

and then adding DNS into /etc/default/docker:

DOCKER_OPTS="--dns 208.67.222.222 --dns 208.67.220.220" 

is another solution to fix this problem? i also tested internet access after rebooting system

0 Answers
Related