PINE64
wifi hotspot no route to Internet - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Arch Linux on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=159)
+---- Thread: wifi hotspot no route to Internet (/showthread.php?tid=14791)



wifi hotspot no route to Internet - dieselnutjob - 08-31-2021

Hi
I am installed arch/phosh yesterday
I got wifi hotspot working, and from my laptop I can ping the phone, but I can't get to the Internet.
I checked the ip forwarding is enabled, and it appears to be.
Can anyone help please?
thanks


RE: wifi hotspot no route to Internet - wibble - 08-31-2021

Before we get to networking configuration, it's been noted in other threads that some mobile providers disable tethering by default, and you have to ask them to enable it.

What exactly did you do to enable a hotspot? I'd be looking at route and gateway settings, and whether you need to set up NAT.


RE: wifi hotspot no route to Internet - dieselnutjob - 08-31-2021

(08-31-2021, 12:57 PM)wibble Wrote: Before we get to networking configuration, it's been noted in other threads that some mobile providers disable tethering by default, and you have to ask them to enable it.

I have used this SIM card in a couple of 4G routers and also in an Android phone using the Android "hotspot" feature and it worked fine.

(08-31-2021, 12:57 PM)wibble Wrote: What exactly did you do to enable a hotspot? I'd be looking at route and gateway settings, and whether you need to set up NAT.

1. settings -> wifi -> selected wifi network in use and selected "forget"

Now the phone has no wifi

2. turn off phone
3. insert SIM card
4. turn on phone
5. settings -> mobile -> Mobile Date slider to "on"
6. settings -> mobile -> Access Point Names -> + and set up the APN
7. terminal -> ping google.com then ctrl-c
8. settings -> wifi
wifi slider set to "on"
tap three dots
Turn On Wi-Fi Hotspot
Fill in network name and Password
Tap "Turn on"

Now another device can connect to the hotspot, and it cannot connect to the Internet.


RE: wifi hotspot no route to Internet - wibble - 09-06-2021

I don't have a data-enabled SIM in it at the moment so I can't try it, but recent reports are that that method should work, at least in Mobian.
https://www.cnx-software.com/2021/08/08/how-to-use-pinephone-as-a-mobile-hotspot/
https://wiki.mobian-project.org/doku.php?id=howto:networking#connection-sharing-tethering
I'd guess that Arch should also work similarly. I don't know what that does with IPv6 though, which may be an issue with some mobile network providers. Have you installed a firewall that may be blocking things?


RE: wifi hotspot no route to Internet - dieselnutjob - 09-06-2021

(09-06-2021, 12:41 PM)wibble Wrote: Have you installed a firewall that may be blocking things?
No. It's a default install. I didn't install anything.


RE: wifi hotspot no route to Internet - wibble - 09-07-2021

This bug/missing feature perhaps, or a similar corner case that's not handled yet?
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/791

I'm not really up to giving a step by step introduction to network troubleshooting in a situation with as many moving parts as this.


RE: wifi hotspot no route to Internet - worden - 10-07-2021

Same here, though DNS queries do work. This seems to be the relevant commands:


Code:
] device (wlan0): supplicant interface state: disconnected -> completed
] device (wlan0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Started Wi-Fi Hotspot "manjaro-arm"
] device (p2p-dev-wlan0): supplicant management interface state: disconnected -> completed
] device (wlan0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
] modprobe: '/sbin/modprobe --use-blacklist nf_nat_irc' exited with error 256 (modprobe: FATAL: Module nf_nat_irc not found in directory /lib/modules/5.14.8-2-MANJARO-ARM)
] modprobe: '/sbin/modprobe --use-blacklist nf_nat_sip' exited with error 256 (modprobe: FATAL: Module nf_nat_sip not found in directory /lib/modules/5.14.8-2-MANJARO-ARM)
] modprobe: '/sbin/modprobe --use-blacklist nf_nat_tftp' exited with error 256 (modprobe: FATAL: Module nf_nat_tftp not found in directory /lib/modules/5.14.8-2-MANJARO-ARM)
] modprobe: '/sbin/modprobe --use-blacklist nf_nat_pptp' exited with error 256 (modprobe: FATAL: Module nf_nat_pptp not found in directory /lib/modules/5.14.8-2-MANJARO-ARM)
] modprobe: '/sbin/modprobe --use-blacklist nf_nat_h323' exited with error 256 (modprobe: FATAL: Module nf_nat_h323 not found in directory /lib/modules/5.14.8-2-MANJARO-ARM)
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol tcp --destination-port 53 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol udp --destination-port 53 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol tcp --destination-port 67 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol udp --destination-port 67 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --in-interface wlan0 --jump REJECT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --out-interface wlan0 --jump REJECT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --in-interface wlan0 --out-interface wlan0 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --source 10.42.0.0/255.255.255.0 --in-interface wlan0 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --destination 10.42.0.0/255.255.255.0 --out-interface wlan0 --match state --state ESTABLISHED,RELATED --jump ACCEPT
] Executing: /usr/bin/iptables --table nat --insert POSTROUTING --source 10.42.0.0/255.255.255.0 ! --destination 10.42.0.0/255.255.255.0 --jump MASQUERADE
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol tcp --destination-port 53 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol udp --destination-port 53 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol tcp --destination-port 67 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert INPUT --in-interface wlan0 --protocol udp --destination-port 67 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --in-interface wlan0 --jump REJECT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --out-interface wlan0 --jump REJECT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --in-interface wlan0 --out-interface wlan0 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --source 10.42.0.0/255.255.255.0 --in-interface wlan0 --jump ACCEPT
] Executing: /usr/bin/iptables --table filter --insert FORWARD --destination 10.42.0.0/255.255.255.0 --out-interface wlan0 --match state --state ESTABLISHED,RELATED --jump ACCEPT
] Executing: /usr/bin/iptables --table nat --insert POSTROUTING --source 10.42.0.0/255.255.255.0 ! --destination 10.42.0.0/255.255.255.0 --jump MASQUERADE
] dnsmasq-manager: starting dnsmasq...
] device (wlan0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
] device (wlan0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
] device (wlan0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
] device (wlan0): Activation: successful, device activated.



RE: wifi hotspot no route to Internet - bcnaz - 10-07-2021

I do not use your step 1. or step 7.
For step 8. I do Not turn on wifi... just tap the three dots to open hot spot window > add name & password > turn on

(Elsewhere on this forum they do mention the wifi must be turned off before activating the hot spot.)


RE: wifi hotspot no route to Internet - antisol - 04-02-2023

Hi I found that after turning on wifi hotspot (which required having wifi turned on) I needed to enable routing through the phone's. Here's the script I use for this, must be invoked with sudo:

Code:
#!/bin/bash
if [ "`whoami`" != root ]; then
    echo "You are not root"
    exit 1
fi
iptables -I INPUT 1 -s 10.42.0.0/24 -j ACCEPT
iptables -I OUTPUT 1 -s 10.42.0.0/24 -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE -s 10.42.0.0/24

If I don't run this on the pinephone I get DNS on clients but no internet.