You are not logged in.

#1 2021-05-15 03:51:37

XiaoaiX
Member
Registered: 2016-01-03
Posts: 10

Setup Static ip using the systemd-networkd

I am trying to setup the static ip using systemd-networkd as in https://wiki.archlinux.org/title/Systemd-networkd . I created a file /etc/systemd/network/20-wired.network

[Match]
Name=enp0s25

[Network]
Address=192.168.2.7/24
Gateway=192.168.2.1
DNS=192.168.3.1

But after

systemctl restart systemd-networkd.service

it seems that the systemd does not read this file. The enp0s25 setup is not changed. It did not get the ip address. What is the problem? Thanks.

Last edited by XiaoaiX (2021-05-15 03:58:04)

Offline

#2 2021-05-15 04:28:41

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Setup Static ip using the systemd-networkd

Do you see something interesting in "journalctl -eb" at the end after the service restart? The "systemctl status systemd-networkd" command will also show a few lines from the journal.

There's a command "networkctl" that might be interesting to look into. You can run "networkctl reconfigure enp0s25". If you check the journal, you'll see it prints the config file names it looks at.

Offline

#3 2021-05-15 13:19:03

ratcheer
Member
Registered: 2011-10-09
Posts: 924

Re: Setup Static ip using the systemd-networkd

It looks like mine (which works), except my DNS specification is in the same subnet. Are you sure yours shouldn't have

DNS=192.168.2.1

Offline

#4 2021-05-15 13:28:00

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Setup Static ip using the systemd-networkd

Output of...

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

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB