9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Last updated at Posted at 2020-06-11

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
9
10
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
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?