firewalldで ポート転送

Table of Contents

firewalldで ポート転送

ローカルサーバの特定ポートを転送して公開する。

IPマスカレードを有効なのが前提

# firewall-cmd --zone=external --add-masquerade --permanent

ポート転送を有効化

# firewall-cmd --zone=external --add-forward-port=port=8080:proto=tcp:toport=80:toaddr=192.168.xxx.yyy --permanent
# firewall-cmd --reload

ポート転送を無効化(削除)

# firewall-cmd --zone=external --remove-forward-port=port=8080:proto=tcp:toport=80:toaddr=192.168.xxx.yyy --permanent
# firewall-cmd --reload

参考URL

5.9. ポート転送 | Red Hat Product Documentation
iptables / firewalldで ポート転送 #MobaXterm – Qiita

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です