Obsah

motivace

FAQ

traverzovani

/-"Full Cone NAT", with the following rules:/

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.2.170
iptables -t nat -A PREROUTING -i eth0 -j DNAT --to-destination 10.0.0.1
/-"Port Restricted Cone NAT", with just a single rule:/

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.2.170
djbuldog@Pharaon:~$ echo "aa" | nc -u veneto.liberouter.org 1235
Pharaon:/home/djbuldog# tcpdump -i eth0 -n  host veneto.liberouter.org and udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
22:57:42.175668 IP 10.10.11.2.59223 > 147.251.21.178.1235: UDP, length 3
root@HomeRouterII:~# tcpdump -i eth0 -n host veneto.liberouter.org and udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
09:22:39.679431 IP 192.168.0.254.59223 > 147.251.21.178.1235: UDP, length 3
veneto(CentOS5) ~ # tcpdump -i eth0 -n host djbuldog.dyndns.org and udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
22:57:41.989465 IP 62.245.126.208.61482 > 147.251.21.178.1235: UDP, length 3
root@HomeRouterII:~# cat /proc/net/ip_conntrack | grep 147.251.21.178
udp      17 55 src=10.10.11.2 dst=147.251.21.178 sport=59223 dport=1235 packets=1 bytes=31 [UNREPLIED] src=147.251.21.178 dst=192.168.0.254 sport=1235 dport=59223 packets=0 bytes=0 mark=0 use=2
djbuldog@Pharaon:~$ sudo mz -B pinot.liberouter.org -t udp dp=12345 -p 100
djbuldog@Pharaon:~$ sudo mz -B veneto.liberouter.org -t udp dp=12345 -p 100
Pharaon:/home/djbuldog# tcpdump -i eth0 -n  udp and port 12345
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
01:25:42.965221 IP 10.10.11.2.0 > 147.251.21.190.12345: UDP, length 100
01:25:47.632213 IP 10.10.11.2.0 > 147.251.21.178.12345: UDP, length 100
root@HomeRouterII:~# tcpdump -i eth0 -n udp and port 12345
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
11:50:40.458579 IP 192.168.0.254.0 > 147.251.21.190.12345: UDP, length 100
11:50:45.125564 IP 192.168.0.254.0 > 147.251.21.178.12345: UDP, length 100
veneto(CentOS5) ~ # tcpdump -i eth0 -n host djbuldog.dyndns.org and udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
01:25:47.273630 IP 62.245.126.208.13369 > 147.251.21.178.12345: UDP, length 100
pinot(CentOS5) ~ # tcpdump -i eth0 -n host djbuldog.dyndns.org and udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
01:25:42.638418 IP 62.245.126.208.13369 > 147.251.21.190.12345: UDP, length 100

aplikace