LoginSignup
1
1

More than 5 years have passed since last update.

CentOS7 iptables 設定

Posted at

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

以上

1
1
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
1
1