1. 防火墙配置

1.1. 防火墙配置文件

$ cat /etc/sysconfig/iptables

1.2. 常用配置参数

1.2.1. -dport

指定目标TCP/IP端口,如--dport 80

1.2.2. -sport

指定源TCP/IP端口 如 –sport 80

1.2.3. -p tcp

指定协议为tcp

1.2.4. -p icmp

指定协议为ICMP

1.2.5. -p udp

指定协议为UDP

1.2.6. -j DROP

拒绝

1.2.7. -j ACCEPT

允许

1.2.8. -j REJECT

拒绝并向发出消息的计算机发一个消息

1.2.9. -j LOG

在/var/log/messages中登记分组匹配的记录

1.2.10. -m mac –mac

绑定MAC地址

1.2.11. -m limit –limit 1/s 1/m

设置时间策列

1.2.12. -s 10.10.0.0或10.10.0.0/16

指定源地址或地址段

1.2.13. -d 10.10.0.0或10.10.0.0/16

指定目标地址或地址段

1.2.14. -s ! 10.10.0.0

指定源地址以外的

作者:garyond 链接:http://www.jianshu.com/p/586da7c8fd42 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

1.3. iptables服务命令

-- 启动服务
# /etc/init.d/iptables start 
# service iptables start

-- 停止服务
# /etc/init.d/iptables stop
# service iptables stop

-- 重启服务
# /etc/init.d/iptables restart
# service iptables restart

-- 保存设置
# /etc/init.d/iptables save
# service iptables save

1.4. iptables 命令

1.4.1. 查看iptables的配置信息

$ iptables -L -n
Copyright © wychuan.com 2017 all right reserved,powered by Gitbook该文件修订时间: 2019-01-08 09:27:34

results matching ""

    No results matching ""