root@NAS:~# tcpdump -i eth0.50 host 10.10.20.200
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0.50, link-type EN10MB (Ethernet), capture size 65535 bytes
04:54:48.199249 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6420, length 40
04:54:53.198669 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6426, length 40
04:54:58.199018 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6432, length 40
04:55:03.199432 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6438, length 40
04:55:08.199687 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6444, length 40
04:55:13.199097 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6450, length 40
04:55:18.199491 IP 192.168.3.2 > 10.10.20.200: ICMP echo request, id 256, seq 6456, length 40
root@NAS:~# netstat -rnl
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.10.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.50
192.168.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
#Включаем сегментацию пакетов
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
#iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -p udp -m udp --dport 139 -j DROP
-A INPUT -i eth0 -p tcp -m tcp --dport 139 -j DROP
-A INPUT -i eth0 -p tcp -m tcp --dport 445 -j DROP
-A INPUT -i eth0 -p udp -m udp --dport 445 -j DROP
-A INPUT -i ppp0 -p udp -m udp --dport 139 -j DROP
-A INPUT -i ppp0 -p tcp -m tcp --dport 139 -j DROP
-A INPUT -i ppp0 -p tcp -m tcp --dport 445 -j DROP
-A INPUT -i ppp0 -p udp -m udp --dport 445 -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -i eth1 -o ppp0 -j ACCEPT
-A FORWARD -i eth1 -o eth0 -j ACCEPT
-A FORWARD -i ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i ppp0 -o eth1 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i eth0 -o eth1 -j REJECT --reject-with icmp-port-unreachable
iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:2014
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
default dev ppp0 scope link
10.8.0.0/24 via 10.8.0.2 dev tun0
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1
10.129.0.0 dev ppp0 proto kernel scope link src 172.16.0.23
192.168.0.0/16 dev eth0 proto kernel scope link src 192.168.20.55
192.168.20.1 dev eth0 scope link src 192.168.20.55
192.168.21.128/29 dev eth1 proto kernel scope link src 192.168.21.132
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:15:17:22:05:c0 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.55/16 brd 192.168.255.255 scope global eth0
inet6 fe80::215:17ff:fe22:5c0/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:15:17:22:05:c1 brd ff:ff:ff:ff:ff:ff
inet 192.168.21.132/29 brd 192.168.21.135 scope global eth1
inet6 fe80::215:17ff:fe22:5c1/64 scope link
valid_lft forever preferred_lft forever
4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1460 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 172.16.0.23 peer 10.129.0.0/32 scope global ppp0
6: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
13: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100
link/none
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
Ссылка по теме:
https://code.google.com/p/firmware-mod-kit/wiki/Do...