æå¼é
ç½®æ件
[root@localhost ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state âstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state âstate NEW -m tcp -p tcp âdport 22 -j ACCEPT
-A INPUT -m state âstate NEW -m tcp -p tcp âdport 80 -j ACCEPT
-A INPUT -j REJECT âreject-with icmp-host-prohibited
-A FORWARD -j REJECT âreject-with icmp-host-prohibited
COMMIT
-A INPUT -m state âstate NEW -m tcp -p tcp âdport * -j ACCEPT
[root@localhost ~]# /etc/init.d/iptables restart
[root@localhost ~]# /etc/init.d/iptables status
[root@localhost ~]# /etc/init.d/iptables stop