はじめに
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: