简体   繁体   English

Android:将数据包转发到 IP 地址

[英]Android : forwarding of packets to an IP address

I have an Android device.我有一个 Android 设备。 I need to forward packets arriving at the external IP to an internal IP to which Android is connected to.我需要将到达外部 IP 的数据包转发到 Android 连接到的内部 IP。

I would like to know if I can write an App to enable this forwarding.我想知道我是否可以编写一个应用程序来启用此转发。

Also, if this doesn't what is the conventional way this is done.此外,如果这不是这样做的常规方法。 If I should use some scripts where should I place them??如果我应该使用一些脚本,我应该把它们放在哪里??

And oh, can I test this using an android emulator??哦,我可以使用 android 模拟器测试这个吗?

Thanks.谢谢。

It is may be possible to emulate a behavior like port forwarding but not routing for non rooted devices.可以模拟端口转发之类的行为,但不能模拟非 root 设备的路由。

Also if you want to forward traffic from the mobile.network to the wlan this is so far I know not possible.另外,如果您想将流量从 mobile.network 转发到 wlan,我知道这是不可能的。 Android switches the co.netion between mobile.network and wlan. Android 在 mobile.network 和 wlan 之间切换 co.netion。 It is not possible to use both.不可能同时使用两者。 Except some hot spot use cases.除了一些热点用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM