Help us understand the problem. What is going on with this article?

iptables周りの備忘録

More than 3 years have passed since last update.

現状登録されている設定内容を行番号付きで確認する

$ /sbin/iptables -L -n --line-number

指定した行番号へiptablesの設定追加する

# /sbin/iptables -I INPUT {行番号} -s {IP/サブネットマスク} -p tcp -m tcp --dport {ポート番号} -j ACCEPT
$ /sbin/iptables -I INPUT 11 -s xxx.xxx.xxx.xxx/255.255.255.255 -p tcp -m tcp --dport 443 -j ACCEPT

iptablesのコンフィグにも保存(再起動した際も反映するようにするため)

$ /etc/init.d/iptables save

iptablesのコンフィグにも設定保存されてることを確認する

$ cat /etc/sysconfig/iptables

間違えて設定入れた時に行番号指定して消すコマンド

# /sbin/iptables -D INPUT {行番号}
$ /sbin/iptables -D INPUT 15

iptablesを再起動した際に、iptablesモジュールをunloadしないようにする設定

window scale optionを無効にする

# 現状のwindow scale optionの確認
[test-user@hoge ~]$ cat /proc/sys/net/ipv4/tcp_window_scaling
1

# iptablesのコンフィグ確認
[root@hoge ~]# grep UNLOAD /etc/sysconfig/iptables-config
IPTABLES_MODULES_UNLOAD="yes"

# IPTABLES_MODULES_UNLOADをnoにする
[root@hoge ~]# vim /etc/sysconfig/iptables-config
IPTABLES_MODULES_UNLOAD="no"

# iptablesの再起動(iptablesモジュールの取り外しが行われなくなる)
[root@hoge ~]# /etc/init.d/iptables restart
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした