LoginSignup
0
0

More than 5 years have passed since last update.

Rancher + k3s 環境での firewalld 設定 Centos7

Posted at

はじめに

OS は、CentOS7 の環境です。
VPSの環境なので、firewallの設定は、疎かにできないので、試行錯誤してみました。
シングルノードなので、複数ノードの場合は、もう少しポートを開ける必要があると思います。

firewall の設定

デフォルトを trusted に設定して、外部接続のネットワークインターフェイスをpublicに設定するのがコツのようです。

# firewall-cmd --set-default-zone=trusted
success
# firewall-cmd --zone=public --change-interface=eth0 --permanent
The interface is under control of NetworkManager, setting zone to 'public'.

Rancher へのアクセスのために

Rancherへのアクセスを544,5080に設定しているので、

# firewall-cmd --add-port=5443/tcp --zone=public --permanent
# firewall-cmd --add-port=5080/tcp --zone=public --permanent

firewall の確認

# firewall-cmd --get-active-zones
public
  interfaces: etch0
# firewall-cmd --list-all --zone=public
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: ssh dhcpv6-client http https
  ports: 5443/tcp 5080/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
# firewall-cmd --list-all
trusted (active)
  target: ACCEPT
  icmp-block-inversion: no
  interfaces: 
  sources:
  services:
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
0
0
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
0
0