You are not logged in.

#1 2024-06-21 16:09:47

redshoe
Member
Registered: 2015-12-16
Posts: 239

[Solved] Internet not working when systemd-networkd.service is enabled

I have two network card installed in my PC, one is wireless card that is connected to a router for internet access, and other one is ethernet card that is connected to another PC. When I manually assign IP to the ethernet card using the command

sudo ip addr add 1.2.3.4/16 dev eno1

then it works fine, meaning that internet works and network stuff through ethernet also works without any problems. Since, I want to permanently assign IP to my ethernet card, I used systemd-networkd. The problem is that when I use this, ethernet works, but my internet does not. The wireless lan card IP holds, but for some reason, web browser says I am not connected to the internet and I can't seem to connect to Arch Linux repos as well. Does anyone have any idea what is going on here? Thanks.

Last edited by redshoe (2024-06-22 01:46:21)

Offline

#2 2024-06-21 17:59:50

-thc
Member
Registered: 2017-03-15
Posts: 739

Re: [Solved] Internet not working when systemd-networkd.service is enabled

If I count correctly this is now your fourth thread on the transfer/cable/SSH/IP topic.

But you never mentioned how you configure your WiFi. Post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-45s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#3 2024-06-21 19:21:30

cryptearth
Member
Registered: 2024-02-03
Posts: 1,087

Re: [Solved] Internet not working when systemd-networkd.service is enabled

in respect to https://bbs.archlinux.org/viewtopic.php … 5#p2178075 : be aware: only use ONE network manager at once ! if you use NetworkManager for your WiFi you also HAVE TO use it for your ethernet - you can NOT use NM for Wifi but systemd for ethernet!

//
also: I recommend two things:

- as this seems ONE BIG topic you should keep it as such - in ONE thread
- as you seem to struggle a lot and seem not to have much knowledge about networking: please just use an external drive via usb - it will save you lot's of issues

aside from that: connecting two systems via an additional network which are already connected to the same network via other means usually causes issues on both networks unless every endpoint is configured properly - which I doubt in your case

Last edited by cryptearth (2024-06-21 19:23:38)

Offline

#4 2024-06-21 19:30:46

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

-thc wrote:

If I count correctly this is now your fourth thread on the transfer/cable/SSH/IP topic.

But you never mentioned how you configure your WiFi. Post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-45s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
dbus-org.freedesktop.network1.service         | system
dbus-org.freedesktop.timesync1.service        | system
dhcpcd@wlp4s0.service                         | multi-user.target.wants
getty@tty1.service                            | getty.target.wants
p11-kit-server.socket                         | sockets.target.wants
remote-fs.target                              | multi-user.target.wants
sshd.service                                  | multi-user.target.wants
systemd-network-generator.service             | sysinit.target.wants
systemd-networkd-wait-online.service          | network-online.target.wants
systemd-networkd.service                      | multi-user.target.wants
systemd-networkd.socket                       | sockets.target.wants
systemd-timesyncd.service                     | sysinit.target.wants
wpa_supplicant@wlp4s0.service                 | multi-user.target.wants

Offline

#5 2024-06-21 19:37:50

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

cryptearth wrote:

in respect to https://bbs.archlinux.org/viewtopic.php … 5#p2178075 : be aware: only use ONE network manager at once ! if you use NetworkManager for your WiFi you also HAVE TO use it for your ethernet - you can NOT use NM for Wifi but systemd for ethernet!

//
also: I recommend two things:

- as this seems ONE BIG topic you should keep it as such - in ONE thread
- as you seem to struggle a lot and seem not to have much knowledge about networking: please just use an external drive via usb - it will save you lot's of issues

aside from that: connecting two systems via an additional network which are already connected to the same network via other means usually causes issues on both networks unless every endpoint is configured properly - which I doubt in your case

Before using systemd-networkd, I have been using wpa_supplicant for wifi, and I am still using it. I didn't know if systemd-networkd would cause problems when used with wpa_supplicant.

And as for your other questions, I thought it would be appropriate to post separate questions, as I see them as separate issue. Of course they are connected, but I didn't want to keep asking following questions and expanding the scope of the original post.

And, Yes, I do lack the knowledge of network issues. But, I would like to learn it by asking questions as I could not really find an answer. As for using an external drive, I choose not to because I mainly archive large climate data on to my other workstation that occupies more than 30 TB of data. And some times I have to manipulate the data on that workstation. So, storing that large amount data on an external drive does not seem reasonable to me. And I would like to transfer them to my current PC time to time. Wireless network takes hours to transfer data, but ethernet works in minutes.

Last edited by redshoe (2024-06-21 19:39:47)

Offline

#6 2024-06-21 19:53:19

-thc
Member
Registered: 2017-03-15
Posts: 739

Re: [Solved] Internet not working when systemd-networkd.service is enabled

If you would like to keep systemd-networkd integrate your WiFi adapter: https://wiki.archlinux.org/title/System … ss_adapter

Offline

#7 2024-06-21 20:21:46

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

-thc wrote:

If you would like to keep systemd-networkd integrate your WiFi adapter: https://wiki.archlinux.org/title/System … ss_adapter

Hmm. Having an extra .network file for wireless card does not seem to work in my favor.. When systemd-networkd.service is up and running, when I ping some server, google for example, my ethernet IP shows up to ping www.google.com. I do use wpa_supplicant separately through systemd

 sudo systemctl enable wpa_supplicant@wlp4s0.service 

Could this be a problem when trying to use systemd-networkd.service?

Last edited by redshoe (2024-06-21 20:23:22)

Offline

#8 2024-06-21 20:46:38

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

dhcpcd@wlp4s0.service                         | multi-user.target.wants

Disable that if you want to use systemd-networkd - neither of them implicitly facilitates a wireless carrier so you need wpa_supplicant or iwd enabled to get that (ie. leave wpa_supplicant@wlp4s0.service enabled)

Offline

#9 2024-06-21 21:16:58

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

seth wrote:
dhcpcd@wlp4s0.service                         | multi-user.target.wants

Disable that if you want to use systemd-networkd - neither of them implicitly facilitates a wireless carrier so you need wpa_supplicant or iwd enabled to get that (ie. leave wpa_supplicant@wlp4s0.service enabled)


It still does not seem to work even with dhcpcd service stop/disabled. Does prefix number for .network file matter in this case (20 in /etc/systemd/network/20-wired.network). Should the number for wireless network be less than the wired network config?

BTW, I have been only using wpa_supplicant before I started using systemd-networkd for any network related application.

Last edited by redshoe (2024-06-21 21:20:43)

Offline

#10 2024-06-21 21:21:34

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

No.
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Edit: after readin your OP also

ip a; ip r

Last edited by seth (2024-06-21 21:22:59)

Offline

#11 2024-06-21 21:24:43

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

seth wrote:

No.
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Edit: after readin your OP also

ip a; ip r

for

sudo journalctl -b | curl -F 'file=@-' 0x0.st

I get

curl: (7) Failed to connect to 0x0.st port 80 after 1521 ms: Couldn't connect to server

Offline

#12 2024-06-21 21:26:56

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

redshoe wrote:
seth wrote:

No.
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Edit: after readin your OP also

ip a; ip r

for

sudo journalctl -b | curl -F 'file=@-' 0x0.st

I get

curl: (7) Failed to connect to 0x0.st port 80 after 1521 ms: Couldn't connect to server

for

ip a; ip r
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: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether e0:4f:43:e6:71:e5 brd ff:ff:ff:ff:ff:ff
    inet 22.0.0.5/16 brd 22.0.255.255 scope global enp1s0
       valid_lft forever preferred_lft forever
    inet6 fe80::e24f:43ff:fee6:71e5/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever
3: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 64:bc:58:5f:66:d5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.20/24 metric 1024 brd 192.168.1.255 scope global dynamic wlp4s0
       valid_lft 86220sec preferred_lft 86220sec
    inet6 fe80::66bc:58ff:fe5f:66d5/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever
default via 22.0.0.1 dev enp1s0 proto static 
default via 192.168.1.1 dev wlp4s0 proto dhcp src 192.168.1.20 metric 1024 
22.0.0.0/16 dev enp1s0 proto kernel scope link src 22.0.0.5 
192.168.1.0/24 dev wlp4s0 proto kernel scope link src 192.168.1.20 metric 1024 
192.168.1.1 dev wlp4s0 proto dhcp scope link src 192.168.1.20 metric 1024

Offline

#13 2024-06-21 21:42:47

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

You've a lease and route on  both devices.

ip route del default via 22.0.0.1 dev enp1s0 proto static

Edit: and please don't bloat the thread with mindless quotes. You failed to upload the journal because you had no internet connection at that time.

Last edited by seth (2024-06-21 21:43:36)

Offline

#14 2024-06-21 21:55:37

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

Okay.  Thanks.

Now, it does work with deleting route on the ethernet. How do I force to route only on wireless device?

Offline

#15 2024-06-21 22:00:08

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

What do your network configs look like?
You can either set the route metrics or (assumign you're currently using dhcp on both NICs?) manually configure the route for the enp1s0 NIC

Did you no read https://wiki.archlinux.org/title/System … me_machine ?

Offline

#16 2024-06-21 22:13:00

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

Well, I got two configs.

for wired

[Match]
Name=enp1s0

[Network]
Address=22.0.0.5/16
Gateway=22.0.0.1

for wireless

[Match]
Name=wlp4s0

[Network]
DHCP=yes

I did read the https://wiki.archlinux.org/title/System … me_machine . I did play around with Metric and RouteMetric for wired and wireless, and I didn't get anywhere.

Last edited by redshoe (2024-06-21 22:15:54)

Offline

#17 2024-06-21 22:39:08

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

The enp1s0 config lacks a destination, https://wiki.archlinux.org/title/Systemd-networkd#[Route]

Offline

#18 2024-06-21 22:39:43

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

Hmm. Removing Gateway and adding UseRoutes=false to the wired network configuration seemed to work.

Offline

#19 2024-06-21 22:41:56

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

Does that preserve the

22.0.0.0/16 dev enp1s0 proto kernel scope link src 22.0.0.5 

route?

Offline

#20 2024-06-21 22:46:03

redshoe
Member
Registered: 2015-12-16
Posts: 239

Re: [Solved] Internet not working when systemd-networkd.service is enabled

This is the output of 'ip r', with the options that I specified above.

default via 192.168.1.1 dev wlp4s0 proto dhcp src 192.168.1.20 metric 1024 
22.0.0.0/16 dev enp1s0 proto kernel scope link src 22.0.0.5 
192.168.1.0/24 dev wlp4s0 proto kernel scope link src 192.168.1.20 metric 1024 
192.168.1.1 dev wlp4s0 proto dhcp scope link src 192.168.1.20 metric 1024

Edit: Now it seems that just removing the Gateway in wired.network config file makes it work. Wonder why...

Last edited by redshoe (2024-06-21 22:51:15)

Offline

#21 2024-06-22 05:56:05

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [Solved] Internet not working when systemd-networkd.service is enabled

Ah, you were https://bbs.archlinux.org/viewtopic.php?id=296785
As ewaller already pointed out, you don't need nor care for a gateway.

Offline

Board footer

Powered by FluxBB