如何在Android上使用iptables转发一个ip到另一个ip

所以如果得到了Android上的iptables。 我的手机上有一个应用程序连接到一个恶意的硬编码IP(让我们称之为192.168.100.1),并发送一些数据。 我想redirect所有的HTTPstream量,从我的手机发到我自己的服务器(让我们叫它192.168.80.1)。

我试过运行以下(在我的手机上),但没有奏效

iptables -t nat -A PREROUTING -p tcp -d 192.168.100.1 --dport 80 -j DNAT --to 192.168.80.1:80 

它添加了以下我的iptables规则(我通过iptables -t nat -L)

 DNAT tcp -- anywhere 192-168-100-1.static.hdcdatacenter.com tcp dpt:www to:192.168.80.1:80 

它添加了以下我的iptables规则(我通过iptables -t nat -nvL)

 0 0 DNAT tcp -- * * 0.0.0.0/0 192.168.100.1 tcp dpt:80 to:192.168.80.1:80 
  1. 我运行正确的iptables命令? 这将redirect所有192.168.100.1:80stream量从我的手机192.168.80.1:80?
  2. formsstatic.hdcdatacenter.com从哪里来,反正阻止它?