- 论坛徽章:
- 0
|
A机eth0:172.16.64.201
B机eth0:172.16.64.202
现在想实现访问 http://172.16.64.202:8181
转到http://172.16.64.201
我是这样写的
iptables -t nat -A PREROUTING -p tcp --dport 8181 -j DNAT --to-destination 172.16.64.201:80
但访问失败
tcpdump的结果是这样的
[root@t-server root]# iptables -t nat -A PREROUTING -p tcp --dport 8181 -j DNAT --to-destination 172.16.64.201:80
[root@t-server root]# tcpdump host 172.16.64.201
tcpdump: listening on eth0
13:43:59.693562 arp who-has 172.16.64.201 tell 172.16.64.202
13:43:59.693757 arp reply 172.16.64.201 is-at 0:c0:9f:27:8a:c4
13:43:59.693767 zxxz.3779 > 172.16.64.201.http: S 2600244193:2600244193(0) win 65535 <mss 1460,nop,nop,sackOK> (DF)
13:43:59.694130 arp who-has 172.16.64.201 tell zxxz
13:44:02.556583 zxxz.3779 > 172.16.64.201.http: S 2600244193:2600244193(0) win 65535 <mss 1460,nop,nop,sackOK> (DF)
13:44:08.571895 zxxz.3779 > 172.16.64.201.http: S 2600244193:2600244193(0) win 65535 <mss 1460,nop,nop,sackOK> (DF)
13:44:20.641118 zxxz.3780 > 172.16.64.201.http: S 2777973927:2777973927(0) win 65535 <mss 1460,nop,nop,sackOK> (DF)
13:44:23.555382 zxxz.3780 > 172.16.64.201.http: S 2777973927:2777973927(0) win 65535 <mss 1460,nop,nop,sackOK> (DF)
13:44:29.570567 zxxz.3780 > 172.16.64.201.http: S 2777973927:2777973927(0) win 65535 <mss 1460,nop,nop,sackOK> (DF)
看不懂这些信息,是不是同一个子网内不能做dnat?如果想实现这样的功能应该怎么写? |
|