LoginSignup
8
9

More than 3 years have passed since last update.

Dockerコンテナからインターネットに繋がらないときに確認すること

Posted at

1. DNSの設定は適切ですか?

コンテナに入って

cat /etc/resolv.conf

をしてnameserverを適切に設定しましょう。わからなければ

nameserver 1.1.1.1

と設定しておきましょう。

2. iptablesにNAT設定は書き込まれていますか?

sudo iptables iptables -t nat -L
sudo systemctl restart docker.service

3. firewalldの設定はされていますか?

dockerの仮想ブリッジはdocker0とします

firewall-cmd --permanent --zone=trusted --change-interface=docker0
firewall-cmd --reload
systemctl restart docker
8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9