Arqade Asked by Nkzlxs on August 17, 2021
In my wifi router, the phone’s internal IP is 192.168.0.152
. I am hosting through port 6666
so i port-forwarded port 6666
to the host 192.168.0.152
in my wifi router.
In my phone, connected with adb shell
, ifconfig
wlan0 Link encap:Ethernet HWaddr 64:CC:2E:27:1B:90
inet addr:192.168.0.152 Bcast:192.168.0.255 Mask:255.255.255.0
rndis0 Link encap:Ethernet HWaddr 06:8D:91:A9:95:3C
inet addr:192.168.42.129 Bcast:192.168.42.255 Mask:255.255.255.0
In my PC (Ubuntu 20.04), ifconfig
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.42.146 netmask 255.255.255.0 broadcast 192.168.42.255
Minecraft’s server.properties
, only two entries were edited, others are kept default
query.port=6666
server-port=6666
I tried the rooted solution provided in this answer
https://android.stackexchange.com/a/207342 which uses iptables
For my case i typed:
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -t nat -I PREROUTING -p tcp --dport 6666 -j DNAT --to 192.168.42.146
iptables -I FORWARD -p tcp -d 192.168.42.146 --dport 6666 -j ACCEPT
Finally i ran the server on my PC, and i was only able to connect to it via 192.168.42.146:6666
{PUBLIC_IP}:6666
was unable to connect and the error are like the following
Thanks for helping!
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP