CentOS7のiptables設定について記載
1.iptablesをインストール
yum -y install iptables-services
2.iptablesの起動と自動起動の設定
systemctl start iptables
systemctl enable iptables
systemctl status iptables
3./etc/ssh/sshd_config にsshのportを追記
vi /etc/ssh/sshd_config
# Port 22
↓
Port 22
4.sshdを再起動
systemctl reload sshd
5.自動起動の設定
systemctl enable sshd
6.iptablesを設定(以下はport追加。各々の設定をしてください。)
iptables -A INPUT -p tcp -m tcp --dport <port_number> -j ACCEPT
・・・
7.iptablesの再読み込み
systemctl restart iptables
以上