iptables -t nat -A PREROUTING -i eth0 -p udp --dport 53 -j DNAT --to-destination 8.8.8.8
iptables -t filter -A FORWARD -d 8.8.8.8 -p udp --dport 53 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -d 8.8.8.8 -p udp --dport 53 -j MASQUERADE
iptables -t filter -A FORWARD -s 8.8.8.8 -p udp --dport 53 -j ACCEPT
iptables -t filter -A FORWARD -j DROP
iptables -t nat -A POSTROUTING -o eth0 -s 8.8.8.8 -p udp --sport 53 -j SNAT --to-source 我的 srv:53
上面 6 条配完, 完全不工作
然后我把最后一条干掉, 结果也怪怪的(如下, 和 8888 也不一样)
难道真的要部署 named?
C:\Documents and Settings\Administrator>nslookup
v2ex.com
Server: UnKnown
Address: 我的 srv
Non-authoritative answer:
Name:
v2ex.com
Addresses: 23.251.126.133, 23.251.125.131
C:\Documents and Settings\Administrator>nslookup
v2ex.com
Server:
google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Name:
v2ex.com
Addresses: 117.34.96.85, 183.60.90.82, 183.60.90.83, 59.173.16.210