Вот мои правила iptables:
Код: Выделить всё
Chain INPUT (policy ACCEPT 2162 packets, 153K bytes)
num pkts bytes target prot opt in out source destination options
1 0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 state NEW recent: UPDATE seconds: 1 hit_count: 5 name: DEFAULT side: source
2 9 540 tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 state NEW recent: SET name: DEFAULT side: source
3 2 120 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:2103
4 0 0 ACCEPT tcp -- * * 0.0.0.0/0 10.0.200.0/24 tcp spts:1:65535 dpt:22
5 244 12822 ACCEPT tcp -- * * 0.0.0.0/0 10.0.200.0/24 tcp spts:1:65535 dpt:80
6 0 0 ACCEPT tcp -- eth0.4094 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
7 0 0 ACCEPT tcp -- eth0.4094 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:23
8 0 0 ACCEPT tcp -- eth0.4094 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
9 1 60 REJECT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 reject-with icmp-port-unreachable
10 0 0 ACCEPT tcp -- vlanL_0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
11 0 0 REJECT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 reject-with icmp-port-unreachable
12 0 0 REJECT tcp -- vlanL_0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:23 reject-with icmp-port-unreachable
13 1 60 REJECT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:23 reject-with icmp-port-unreachable
14 0 0 ACCEPT tcp -- vlanL_0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
15 0 0 REJECT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 reject-with icmp-port-unreachable
16 0 0 REJECT tcp -- vlanL_0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:20 reject-with icmp-port-unreachable
17 0 0 REJECT tcp -- vlanL_0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:21 reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT 76856 packets, 103M bytes)
num pkts bytes target prot opt in out source destination options
1 65 3852 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
2 0 0 DROP all -- vlanL_0 !ppp0 0.0.0.0/0 !224.0.0.0/4
3 0 0 DROP all -- ppp0 !vlanL_0 0.0.0.0/0 !224.0.0.0/4
4 0 0 DROP all -- eth2.2 !eth0.2 0.0.0.0/0 !224.0.0.0/4
5 0 0 DROP all -- eth0.2 !eth2.2 0.0.0.0/0 !224.0.0.0/4
6 0 0 DROP all -- br1 * 0.0.0.0/0 !224.0.0.0/4
7 0 0 DROP all -- * br1 0.0.0.0/0 !224.0.0.0/4
8 0 0 DROP all -- br2 * 0.0.0.0/0 !224.0.0.0/4
9 0 0 DROP all -- * br2 0.0.0.0/0 !224.0.0.0/4
10 0 0 DROP all -- br3 * 0.0.0.0/0 !224.0.0.0/4
11 0 0 DROP all -- * br3 0.0.0.0/0 !224.0.0.0/4
12 2 120 ACCEPT tcp -- ppp0 * 0.0.0.0/0 10.0.200.254 tcp dpt:80
13 2 120 ACCEPT tcp -- ppp0 * 0.0.0.0/0 10.0.200.254 tcp dpt:22
14 0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 10.0.200.0/24 tcp spts:1:65535 dpt:22
15 0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 10.0.200.0/24 tcp spts:1:65535 dpt:80
Chain OUTPUT (policy ACCEPT 2374 packets, 219K bytes)
num pkts bytes target prot opt in out source destination options
1 0 0 DROP all -- * eth0.4094 0.0.0.0/0 0.0.0.0/0 ! owner UID match 0
2 0 0 ACCEPT tcp -- * * 0.0.0.0/0 10.0.200.254 tcp dpt:80
3 0 0 ACCEPT tcp -- * * 0.0.0.0/0 10.0.200.254 tcp dpt:22
Target NAT
Chain PREROUTING (policy ACCEPT 2316 packets, 169K bytes)
num pkts bytes target prot opt in out source destination options
1 2 120 DNAT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:10.0.200.254:80
2 2 120 DNAT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 to:10.0.200.254:22
Chain POSTROUTING (policy ACCEPT 4 packets, 240 bytes)
num pkts bytes target prot opt in out source destination options
1 274 31939 MASQUERADE all -- * ppp0 0.0.0.0/0 0.0.0.0/0
2 0 0 MASQUERADE all -- * eth0.2 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 63 packets, 5013 bytes)
num pkts bytes target prot opt in out source destination options
Target Mangle
Chain PREROUTING (policy ACCEPT 8970K packets, 12G bytes)
num pkts bytes target prot opt in out source destination options
Chain INPUT (policy ACCEPT 332K packets, 27M bytes)
num pkts bytes target prot opt in out source destination options
Chain FORWARD (policy ACCEPT 8405K packets, 11G bytes)
num pkts bytes target prot opt in out source destination options
Chain OUTPUT (policy ACCEPT 320K packets, 35M bytes)
num pkts bytes target prot opt in out source destination options
Chain POSTROUTING (policy ACCEPT 8724K packets, 11G bytes)
num pkts bytes target prot opt in out source destination options
Вот как видится устройство в интернетах:
Код: Выделить всё
Starting Nmap 5.00 ( http://nmap.org ) at 2012-07-30 17:17 OMST
Interesting ports on ******.omsknet.ru (***.***.***.***):
Not shown: 995 closed ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp filtered ssh
25/tcp open smtp
80/tcp filtered http
2103/tcp filtered zephyr-clt
Всё сделано вроде верно, но 80ой и 22ой порт все равно фильтрованы. И некая почта на 25ом порту, которой ни в локальной сети, ни на устройстве - нет. И что такое на 2103 висит?