You are not logged in.

#1 2022-10-20 22:26:28

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

[SOLVED] cURL fails to connect after successful ioctl connection

I have been using Linux for about 1 month now. I am unfamiliar with Linux, but familiar with bash.

`lspci | grep Network`:

0000:01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter

`iwctl station wlan0 show`:

Scanning no
State connected
Connected network *************
IPv6 address ***************
ConnectedBss ************
Frequency 5300
Security WPA2-Personal
RSSI -52 dBm
AverageRSSI -51 dBm
RxMode 802.11ac
RxMCS 9
TxBitrate 390000 Kbit/s
RxBitrate 292500 Kbit/s

However, cURL (and therefore pacman) fails:

curl: (6) Could not resolve host: archlinux.org

Typically this means that I am not connected to the internet, but iwctl states otherwise, and rfkill is not blocking anything. I am very confused why I am not able to cURL anything when I could perfectly fine on the Arch installation USB stick.

Any help is greatly appreciated. Thanks!

Last edited by Arthurmeade12 (2023-11-01 19:36:22)

Offline

#2 2022-10-21 00:55:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,655

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Do you have an IPv4 address?  Does the IPv6 address start with fe80: ?

Do either of these commands work?

ewaller@odin/home/ewaller[1] % resolvectl query archlinux.org
archlinux.org: 95.217.163.246                  -- link: wlan0
               2a01:4f9:c010:6b1f::1           -- link: wlan0

-- Information acquired via protocol DNS in 85.7ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no
-- Data from: network
ewaller@odin/home/ewaller % dig archlinux.org

; <<>> DiG 9.18.7 <<>> archlinux.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35958
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;archlinux.org.                 IN      A

;; ANSWER SECTION:
archlinux.org.          987     IN      A       95.217.163.246

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Oct 20 17:55:09 PDT 2022
;; MSG SIZE  rcvd: 58

ewaller@odin/home/ewaller % 

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2022-10-21 04:06:34

lfitzgerald
Member
Registered: 2021-07-16
Posts: 175

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Connecting to archlinux.org involves two things: First resolving the IP of archlinux.org through DNS, then going to that IP. ewaller's post shows how to check the DNS part. You can see from his result that the IP is  95.217.163.246. Try that IP directly. If you see something like this, your internet is up, the problem is the DNS config of your Arch computer:

$ ping -c 3 95.217.163.246
PING 95.217.163.246 (95.217.163.246) 56(84) bytes of data.
64 bytes from 95.217.163.246: icmp_seq=1 ttl=51 time=168 ms
64 bytes from 95.217.163.246: icmp_seq=2 ttl=51 time=193 ms
64 bytes from 95.217.163.246: icmp_seq=3 ttl=51 time=212 ms

--- 95.217.163.246 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 168.494/191.205/212.413/17.961 ms

Also, try to ping the router you're connected to. That will show you if the WLAN is messed up, or just the internet. Don't know how to see the router IP from iwctl, but for me "ip route show" works. Usually it's something like 192.168.1.1.

Offline

#4 2022-10-21 06:58:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Also post the outputs of "ip a" and "ip r"
Just because you've a connection doesn't mean you've a lease or route.

Unless you're using https://wiki.archlinux.org/title/Iwd#En … figuration you'd also have to run sth. like dhcpcd or statically configure IP and route.

Ftr. on a healthy LAN you can "ping _gateway"

Offline

#5 2022-10-21 22:31:48

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Ping command outputs:
ping: connect: Network is unreachable
Dig is not installed and cannot be installed without a connection.
Output of ip a:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 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
2: wlan0: <BROADCAST,MULRICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b4:b5:b6:d9:e0:79 brd ff:ff:ff:ff:ff
inet6 ****:****:****:****:****:****:****:****/64 scope global dynamic mngtmpaddr
valid_lft 3486sec preferred_lft 3486sec
inet6 ****::****:****:****:****/64 scope link
valid_lft forever preferred_lft forever

ip r executed successfully with no output.
FYI, I am typing all of this on a phone, so please don't ask for too much Output.
Thanks for all the help!

Offline

#6 2022-10-21 22:45:39

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Edit: just changed iwd'd configuration to
[General]
EnableNetworkConfiguration=true
EnableIPv6=true

I restarted and the issue persisted.

Interesting output from `systemctl status iwd`:
iwd[297]: hardware_rekey not supported
...
iwd[297]: WARNING: src/resolve.c:resolve_systemd_set_dns()  condition !systemd_state.is_ready failed
iwd[297]: WARNING: src/resolve.c:resolve_systemd_set_domains() condition !systemd_state.is_ready failed

FYI, I am running all this as root. If I use my user, iwctl can't even connect to iwd:
Rejected send message, 2 matched rules ...

I can provide more output of that if it is useful.

Offline

#7 2022-10-21 22:48:13

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

More info I forgot to include:
sth is not installed and cannot be, due to my inability to connect.
However, ping _gateway works perfectly fine.
Again, thanks for all the help.

Offline

#8 2022-10-22 06:40:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Please use "code" tags, https://bbs.archlinux.org/help.php#bbcode and post an updated output of "ip a" and "ip r" (link a photo of your monitor, if you must - don't embed it) and try to

ping 8.8.8.8

I suspect you now have a lease and route, but no DNS since resolved isn't enabled and you didn't configure it to use resolvconf, https://wiki.archlinux.org/title/iwd#Select_DNS_manager

Offline

#9 2022-10-22 14:34:17

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,655

Re: [SOLVED] cURL fails to connect after successful ioctl connection

I don't see an IPv4 address.  As the output of IPv6 has been conveniently redacted, we have no way to determine if the IPv6 addresses are link local.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2022-10-22 14:38:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

We'll need an update *after* the OP added EnableNetworkConfiguration=true because before that there was not lease for pretty much sure.

Offline

#11 2022-10-22 17:25:27

lfitzgerald
Member
Registered: 2021-07-16
Posts: 175

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Arthurmeade12 wrote:

Dig is not installed and cannot be installed without a connection.

You can download the package directly on some other machine. For example, dig is part of bind, which you can find at https://archive.archlinux.org/packages/b/bind/. Make sure to download a version that is close to the date you last installed/updated Arch, because if the version of bind is too far ahead your system it will not work (due to dependency version mismatches). You can then do "sudo pacman -S ./bind-....pkg.tar.zst".

Arthurmeade12 wrote:

FYI, I am typing all of this on a phone, so please don't ask for too much Output.

When you're running any command, you can redirect stdout and stderr to a file like so: "ip route show >/tmp/foo.txt 2>/tmp/foo.txt". Then you can send the foo.txt to your phone so you can copy from it.

You can also try to connect the phone to your PC with a USB cable and enable the hotspot, to temporarily get internet that way. Or if you can, connect your PC to the router with an ethernet cable, that often works even when wifi doesn't.

Last edited by lfitzgerald (2022-10-22 17:26:08)

Offline

#12 2022-10-22 19:15:13

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Thanks for the suggestion about stdout/err redirection. Forgot about those.
https://raw.githubusercontent.com/Arthu … 075141.jpg


Mod Edit - Replaced oversized image with link.
CoC - Pasting pictures and code

Last edited by Slithery (2022-10-22 20:08:21)

Offline

#13 2022-10-22 19:28:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

seth wrote:

link a photo of your monitor, if you must - don't embed it

Also we're missing an updated ip a/ip r and finally, iwd quit - possibly because you're telling it to configure the network w/ resolvconf, but don't have resolvconf installed.
Remove "NameResolvingService=resolvconf" again and restart iwd and then post the outputs.

Offline

#14 2022-10-22 19:58:50

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Terminal image: Image

Offline

#15 2022-10-22 20:16:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

You've a carrier and a lease, it's now probably down to the resolver.

resolvectl status
stat /etc/resolv.conf

Offline

#16 2022-10-23 20:38:38

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Image: Image

Offline

#17 2022-10-23 23:30:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Do you have either systemd-resolvconf or openresolv installed? See https://wiki.archlinux.org/title/Iwd#Select_DNS_manager.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#18 2022-10-24 06:26:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Appending

nameserver 1.1.1.1
nameserver 8.8.8.8

to /etc/resolv.conf will get you DNS resolution over cloudflares and googles DNS.
You should then have internet™.

You can either install and configure openresolv or simply start/enable systemd-resolved (though I want to be very clear that I in no way endorse that … thing) to allow iwd to configure your resolver.

Offline

#19 2022-10-25 22:19:56

Arthurmeade12
Member
From: U.S.A
Registered: 2022-10-18
Posts: 54
Website

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Followed instructions to get successful internet connection.
Thanks so much for the help!

Offline

#20 2022-10-26 06:18:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: [SOLVED] cURL fails to connect after successful ioctl connection

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB