我把我安卓手机网络共享了,而且搭建了web环境。
我想让所有连接这个无线的网络的http访问全部定向到我手机的ip192.168.43.1
我想让所有连接这个无线的网络的http访问全部定向到我手机的ip192.168.43.1
|
1
安卓如果root了,可以使用iptables来完成
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.42.1 |
|
2
|
|
3
@ccbikai 再删除这条iptables规则呗(-A表示append, -D表示delete)
iptables -t nat -D PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.42.1 |
|
4
|
|
6
@tarsier 还是可以的。
|
|
7
|
|
8
|
|
tarsierMay 28, 2013
9
@ccbikai 搜了下,你试试这个解决办法 http://stackoverflow.com/questions/10331699/getprotobyname-error-iptables
iptables -A INPUT -p 6 替代 iptables -A INPUT -p tcp |
|
11
|
|
12
|
|
15
@tarsier 多的 ,其他机器的浏览器
|
|
17
@tarsier 可以的 。
|
|
tarsierMay 28, 2013
18
@ccbikai
把上面的命令换成这个试试: iptables -t nat -A PREROUTING -s xxxx/xx(你的共享wifi所在的网段) -p tcp --dport 80 -j REDIRECT --to-ports 80 |
|
tarsierMay 28, 2013
19
xxxx/xx 是 类似 192.168.1.0/24 这种格式的ip段
|
|
20
|