Can鈥檛 connect to public WiFi via Linux

I am using Fedora 42, and I am unable to access the captive portal of inOui TGV. I can connect to the WiFi with no problems, but I can鈥檛 get access to the Internet.

I have tried everything:

  1. Connecting to 192.168.1.1, to http://neverssl.com, to http://wifi.sncf via browser
  2. Running sudo dhclient -r and rebooting the device
  3. Running systemctl restart NetworkManager
  4. Also other stuff I tried in the past with other public WiFis. I am sure there is something wrong with my specific device configuration, it鈥檚 not this network.

Nothing works 馃槱

Can somebody who understands this stuff help me?

@tommi my recent experience with captive portals and linux has been that many captive portals' log-in pages are served with broken DNS that can only be resolved using the DNS server provided by DHCP from the router hosting the captive portal. if you instead use a "sans" DNS server (1.1.1.1 or 8.8.8.8 or 4.2.2.1 or whatever browsers reach via DNS-over-HTTP) you won't be able to reach the portal login page. you might need to add the captive portal's one to /etc/resolv.conf

Thanks for replying, @FandaSin and all!

Here are the outputs of several info commands:

ip route:

default via 10.17.0.2 dev wlp1s0 proto dhcp src 10.17.4.41 metric 600
10.17.0.0/21 dev wlp1s0 proto kernel scope link src 10.17.4.41 metric 600

ip a:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 86:67:7f:b5:b8:e1 brd ff:ff:ff:ff:ff:ff permaddr 14:ac:60:29:7d:17
altname wlx14ac60297d17
inet 10.17.4.41/21 brd 10.17.7.255 scope global dynamic noprefixroute wlp1s0
valid_lft 101sec preferred_lft 101sec
inet6 fe80::747e:df9:ee7e:71c0/64 scope link noprefixroute
valid_lft forever preferred_lft forever

ifconfig:

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1264 bytes 95511 (93.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1264 bytes 95511 (93.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.17.4.41 netmask 255.255.248.0 broadcast 10.17.7.255
inet6 fe80::747e:df9:ee7e:71c0 prefixlen 64 scopeid 0x20<link>
ether 86:67:7f:b5:b8:e1 txqueuelen 1000 (Ethernet)
RX packets 12653 bytes 744838 (727.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7864 bytes 665881 (650.2 KiB)
TX errors 0 dropped 25 overruns 0 carrier 0 collisions 0

resolve.conf:

nameserver 127.0.0.53
options edns0 trust-ad
search .
@FandaSin beat me to it.

Start by checking that the IP addresses and ideally also routing table is reasonable. Try `ping -n` the default gateway by IP address. (`-n` turns off reverse DNS lookups.)

Check /etc/resolv.conf to make sure it has correct nameservers. Try `ping -n` those by IP address, see if they respond.

`nmcli general status` and `nmcli networking connectivity check` and `nmcli connection show` might also be helpful.

@tommi

@thibaultmol @tommi I don't use Fedora, so I might be useless for this, but it sounds like you might be connecting to an open wifi, not your router. If that's the case, you'll need to get the password and wifi name to use it. It does your routing, and should provide you with nameservers for DNS.

Try this:

ping 1.1.1.1

If you can't ping them, you aren't connected to the internet. If you can ping them, you are connected, but have a DNS problem (which would become apparent if you tried to ping yahoo.com and got nothing back). Perhaps your router doesn't provide nameservers. You could set 1.1.1.1 and 1.0.0.1 as your nameservers. They are public, and always available.

As I said, I don't use Fedora (it's been years). Just a guess.