CentOS iptables基本应用


Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/cuijunwei/wp-content/plugins/crayon-syntax-highlighter/util/crayon_util.class.php on line 793

一般系统都会自带iptables,如果没有自带,请用yum install直接安装。

1、开放指定端口

2、屏蔽指定IP(可选)

如果有些已知IP是经常爆你的服务器的话,可以用规则将其屏蔽。

3、保存规则&开机启动

4、后续:查看与删除已经添加的规则

将所有iptables以序号标记显示,执行:

比如要删除INPUT里序号为8的规则,执行:

清除已有所有的iptables规则

发表评论

电子邮件地址不会被公开。 必填项已用*标注