YunoHost-Apps / hotspot_ynh

Wifi Hotspot app for YunoHost
GNU Affero General Public License v3.0
39 stars 19 forks source link

Fixing no internet connection #88

Closed 5k4nd closed 2 years ago

5k4nd commented 2 years ago

Problem

Before this PR, (and after having run ynh-hotspot), iptables -nvL -t nat outputs:

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MASQUERADE  all  --  *      202     0.0.0.0/0            0.0.0.0/0

(note the weird out:202)

After this PR, iptables -nvL -t nat correctly outputs:

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    2   181 MASQUERADE  all  --  *      eth0    0.0.0.0/0            0.0.0.0/0

Solution

I don't know for others but on my setup (see https://github.com/YunoHost-Apps/hotspot_ynh/issues/87) ip routes outputs:

ip route
default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.20 metric 202

then the original line

new_internet_device=$(ip route | awk '/default via/ { print $NF; }')

was outputting 202 instead of eth0.

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

Thatoo commented 2 years ago

Should we wait for this PR to be merged before updating? Should we avoid updating to 2.0~ynh2 and wait for 2.0~ynh3?

alexAubin commented 2 years ago

Merging, cheers !