|
发表于 2008-2-26 10:44:13
|
显示全部楼层
请问下我这样是不是加载成功呢?
Local Custom Firewall rules
Level 7 Filtering example:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto edonkey -j DROP
iptables -I FORWARD -p tcp -s 192.168.0.11 -m connlimit --connlimit-above 25 -j REJECT
iptables -I FORWARD -p tcp -s 192.168.0.9 -m connlimit --connlimit-above 10 -j REJECT
Attention: To enable the commands below can cause some side effects
Syn-flood and DOS protection
iptables -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT
Port Scanners protection
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
iptables -A FORWARD -p tcp --tcp-flags ALL SYN,ACK -j DROP
Ping-of-dead protection
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
Speed UP DNS
iptables -t mangle -A OUTPUT -p udp --dport 53 -j TOS --set-tos 0x08
iptables -t mangle -A PREROUTING -p udp --dport 53 -j TOS --set-tos 0x10
Speed UP HTTP
iptables -t mangle -A OUTPUT -p tcp -j TOS --sport 80 --set-tos 0x08
iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TOS --set-tos 0x08
iptables -t mangle -A OUTPUT -p tcp -j TOS --sport 80 --set-tos 0x10
ipt_connlimit
iptables -I FORWARD -p tcp -s 192.168.0.11 -m connlimit --connlimit-above 25 -j REJECT
iptables -I FORWARD -p tcp -s 192.168.0.9 -m connlimit --connlimit-above 10 -j REJECT
iptables -I FORWARD -p tcp -s 192.168.0.$a -m connlimit --connlimit-above 20 -j REJECT
iptables -I INPUT -p tcp -s 192.168.0.$a -m connlimit --connlimit-above 20 -j REJECT
a=`expr $a "+" 1`
这是我加载的内容
Chain INPUT (policy ACCEPT 58364 packets, 4099K bytes)
pkts bytes target prot opt in out source destination
686K 51M accounting all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 REJECT tcp -- * * 202.111.148.132 0.0.0.0/0 #conn/32 > 20 reject-with icmp-port-unreachable
46827 12M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
3183 263K DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
636K 39M remote-admin all -- * * 0.0.0.0/0 0.0.0.0/0
636K 39M user-filter all -- * * 0.0.0.0/0 0.0.0.0/0
636K 39M if-filter all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
Chain FORWARD (policy ACCEPT 538K packets, 37M bytes)
pkts bytes target prot opt in out source destination
613 191K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.135 tcp dpt:80
3276 202K ACCEPT udp -- * * 0.0.0.0/0 192.168.0.20 udp dpt:20191
14 672 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.20 tcp dpt:80
754 546K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.133 tcp dpt:80
804 475K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.133 tcp dpt:80
2444 1656K ACCEPT udp -- * * 0.0.0.0/0 192.168.0.24 udp dpt:15000
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.24 tcp dpt:80
11M 1022M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.128 udp dpt:4168
147K 17M ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.128 tcp dpt:4043
490K 70M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.128 udp dpt:4168
20311 1896K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.128 tcp dpt:4043
5 325 ACCEPT udp -- * * 0.0.0.0/0 192.168.0.128 udp dpt:15000
86 4618 ACCEPT udp -- * * 0.0.0.0/0 192.168.0.36 udp dpt:15000
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.36 tcp dpt:80
161 8593 ACCEPT udp -- * * 0.0.0.0/0 192.168.0.18 udp dpt:15000
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.18 tcp dpt:80
446K 464M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.121 udp dpt:1
35641 6892K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.121 tcp dpt:1
624K 702M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.34 udp dpt:15000
15686 9335K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.34 tcp dpt:80
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.254 tcp dpt:44501
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.254 tcp dpt:44500
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.254 tcp dpt:21
349K 325M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.130 udp dpt:15000
43373 20M ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.130 tcp dpt:80
9921 7493K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.132 tcp dpt:80
27969 23M ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.120 tcp dpt:1
419K 460M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.130 udp dpt:15000
39760 18M ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.130 tcp dpt:80
116 6166 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.130 tcp dpt:80
92291 54M ACCEPT udp -- * * 0.0.0.0/0 192.168.0.35 udp dpt:15000
13112 3606K ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.35 tcp dpt:80
42M 28G ipacc all -- * * 0.0.0.0/0 0.0.0.0/0
42M 28G accounting all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 REJECT tcp -- * * 202.111.148.132 0.0.0.0/0 #conn/32 > 20 reject-with icmp-port-unreachable
502 27646 REJECT tcp -- * * 192.168.0.9 0.0.0.0/0 #conn/32 > 10 reject-with icmp-port-unreachable
0 0 REJECT tcp -- * * 192.168.0.11 0.0.0.0/0 #conn/32 > 25 reject-with icmp-port-unreachable
0 0 REJECT tcp -- * * 192.168.0.9 0.0.0.0/0 #conn/32 > 10 reject-with icmp-port-unreachable
0 0 REJECT tcp -- * * 192.168.0.11 0.0.0.0/0 #conn/32 > 25 reject-with icmp-port-unreachable
41M 28G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
591K 40M access-acl all -- * * 0.0.0.0/0 0.0.0.0/0
591K 40M autofw-acl all -- * * 0.0.0.0/0 0.0.0.0/0
591K 40M portfw-acl all -- * * 0.0.0.0/0 0.0.0.0/0
590K 40M user-filter all -- * * 0.0.0.0/0 0.0.0.0/0
590K 40M port-filter all -- * * 0.0.0.0/0 0.0.0.0/0
590K 40M if-filter all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
34875 1789K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02 limit: avg 1/sec burst 5
6 240 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5
178 8736 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x12
17239 1166K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 8 limit: avg 1/sec burst 5
Chain OUTPUT (policy ACCEPT 65705 packets, 12M bytes)
pkts bytes target prot opt in out source destination
65555 12M accounting all -- * * 0.0.0.0/0 0.0.0.0/0
Chain access-acl (1 references)
pkts bytes target prot opt in out source destination
Chain accounting (3 references)
pkts bytes target prot opt in out source destination
17M 15G RETURN all -- eth1 * 0.0.0.0/0 0.0.0.0/0
26M 13G RETURN all -- * eth1 0.0.0.0/0 0.0.0.0/0
168K 27M RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
Chain autofw-acl (1 references)
pkts bytes target prot opt in out source destination
Chain if-filter (2 references)
pkts bytes target prot opt in out source destination
578K 35M log-and-drop all -- eth1 * 0.0.0.0/0 0.0.0.0/0
Chain ipacc (1 references)
pkts bytes target prot opt in out source destination
42M 28G RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
Chain log-and-drop (1 references)
pkts bytes target prot opt in out source destination
578K 35M DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain port-filter (1 references)
pkts bytes target prot opt in out source destination
Chain portfw-acl (1 references)
pkts bytes target prot opt in out source destination
258 12384 ACCEPT tcp -- * * 0.0.0.0/0 192.168.0.254 tcp dpt:88
Chain remote-admin (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spts:1024:65535 dpt:6689
Chain user-filter (2 references)
pkts bytes target prot opt in out source destination
这是我防火墙内容``` |
|