You are not logged in.

#1 2024-03-03 19:36:47

forward_one
Member
Registered: 2023-06-30
Posts: 32

systemd-networkd ( .network ) not working

initially, I was trying to set up a bridge. but I can't even set up a static ip.

cat 11-enp3s0.network

[Match]
Name=enp3s0

[Network]
Address=192.168.12.2/24
Gateway=192.168.12.1
DNS=192.168.12.1

ip a

2: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 50:7b:9d:8e:86:0f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::527b:9dff:fe8e:860f/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

systemctl restart systemd-networkd
journalctl -u systemd-networkd

systemd[1]: Stopping Network Configuration...
systemd[1]: systemd-networkd.service: Deactivated successfully.
systemd[1]: Stopped Network Configuration.
systemd[1]: Starting Network Configuration...
systemd-networkd[266731]: lo: Link UP
systemd-networkd[266731]: lo: Gained carrier
systemd-networkd[266731]: enp3s0: Link UP
systemd-networkd[266731]: br0_1: netdev ready
systemd-networkd[266731]: br0_1: Link UP
systemd-networkd[266731]: wlan0: Link UP
systemd-networkd[266731]: enp0s20u1: Link UP
systemd-networkd[266731]: enp0s20u1: Gained carrier
systemd-networkd[266731]: enp3s0: Gained IPv6LL
systemd-networkd[266731]: enp0s20u1: Gained IPv6LL
systemd-networkd[266731]: Enumeration completed
systemd[1]: Started Network Configuration.
systemd-networkd[266731]: br0_1: netdev exists, using existing without changing its parameters
systemd-networkd[266731]: enp3s0: Configuring with /etc/systemd/network/11-enp3s0.network.

Offline

#2 2024-03-03 21:07:49

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

Re: systemd-networkd ( .network ) not working

Is enp3s0 already a member of a bridge?

brctl show

Are there other *.netdev and *.network files?

Offline

#3 2024-03-03 23:42:23

yxcv
Member
Registered: 2024-02-13
Posts: 27

Re: systemd-networkd ( .network ) not working

-thc wrote:

Is enp3s0 already a member of a bridge?

brctl show

Are there other *.netdev and *.network files?

as far as I can read
enp3s0
doesn't have an IPV4 address at all

if you would like to add one to it you should stop it first
then adding should work
Do you try it already?

This isn't necessary for IPV6 therefor I only use IPV6

#There is an old script
ip link set dev enp**** down
ip addr flush dev  enp****
ip addr add dev enp**** 192.168.12.2/24 broadcast 192.168.12.255
ip link set dev enp**** up
#BUT!
ip route add default dev  enp**** src 192.168.12.2 via  192.168.12.1
#afterwards

Then you can start bridging?


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

#4 2024-03-03 23:46:13

yxcv
Member
Registered: 2024-02-13
Posts: 27

Re: systemd-networkd ( .network ) not working

as far as I can read
enp3s0
doesn't have an IPV4 address at all

if you would like to add one to it you should stop it first
then adding should work
Do you try it already?

This isn't necessary for IPV6 therefor I only use IPV6

#There is an old script
ip link set dev enp**** down
ip addr flush dev  enp****
ip addr add dev enp**** 192.168.12.2/24 broadcast 192.168.12.255
ip link set dev enp**** up
#BUT!
ip route add default dev  enp**** src 192.168.12.2 via  192.168.12.1
#afterwards

Then you can start bridging?


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

#5 2024-03-04 09:21:24

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

I can control via command "ip". I want to configure everything using configurations.

Turning off the interface didn't help ( ip .... down )

I have an assumption that I have conflicting managers working for me. I tried turning it off NetworkManager. But it did not help

Offline

#6 2024-03-04 09:57:38

yxcv
Member
Registered: 2024-02-13
Posts: 27

Re: systemd-networkd ( .network ) not working

ip a
ip link set dev enp3s0 down
ip a
put all results down  here.


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

#7 2024-03-04 11:33:51

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

ip a

2: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 50:7b:9d:8e:86:0f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::527b:9dff:fe8e:860f/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

ip link set dev enp3s0 down
ip a

2: enp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 50:7b:9d:8e:86:0f brd ff:ff:ff:ff:ff:ff


!!! before that, I was not connected by cable !!!
now a strange thing has arisen. now I'm connected by cable. and free.network is working. and it shows the additional static ip that I specified in the configuration

ip a

2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 50:7b:9d:8e:86:0f brd ff:ff:ff:ff:ff:ff
    inet 192.168.12.2/24 brd 192.168.12.255 scope global enp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::c53a:357:ebc6:1337/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::1090:e339:8281:57f8/64 scope link 
       valid_lft forever preferred_lft forever

Offline

#8 2024-03-04 14:38:00

yxcv
Member
Registered: 2024-02-13
Posts: 27

Re: systemd-networkd ( .network ) not working

!!! before that, I was not connected by cable !!! smile)
Everthing else looks fine

Next step:
#ip r .............it should bring
#ip route add default dev  enp3s0 src 192.168.12.2 via  192.168.12.1
#now yourse?
meanwhile try: ping 192.168.12.1


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

#9 2024-03-05 12:15:15

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

everything stops working for me if I pull out the internet cable

Offline

#10 2024-03-05 15:42:48

yxcv
Member
Registered: 2024-02-13
Posts: 27

Re: systemd-networkd ( .network ) not working

really? :-P))


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

#11 2024-03-06 15:05:46

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

I screwed up here. will you also help me with configuring the bridge also in the configuration of free.netdev and free.network?

pwd: /etc/systemd/network
ls

10-br0.netdev  11-br0.netdev

cat 10-br0.netdev

[Match]
Virtualization=false

[NetDev]
Name=br0_1
Kind=bridge

[Bridge]
HelloTimeSec=10
MaxAgeSec=10
Priority=65000
DefaultPVID=1

cat 11-br0.netdev
( empty )

I tried to set up a bridge and from the documentation I realized that it cannot exist without binding to another interface (as a result, a static ip cannot be configured). but no matter how I try, I can't create it.

Offline

#12 2024-03-06 17:12:08

yxcv
Member
Registered: 2024-02-13
Posts: 27

Re: systemd-networkd ( .network ) not working

man  ip
read carefully, think carefully, try exactly.
control via
www.baturin.org/docs/iproute2
and you will see all the mistakes you made

making mistakes is not a mistake. 
the only and real mistake is to gitve up.


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

#13 2024-03-27 13:40:42

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

Now I sort of more or less figured out systemd-networkd. I even reread the documentation several times. but I still can't figure out how to configure the bridge. I noticed that the bridge works and even when configuring DHCP it connects to another interface (only the ip is not received by the bridge, but by the interface - the interface receives another additional ip). the mac address also changes. but I can't get the bridge to work. for example as a DHCPServer.

Last edited by forward_one (2024-03-27 13:41:01)

Offline

#14 2024-03-27 15:52:22

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

Re: systemd-networkd ( .network ) not working

Setting up a bridge with systemd-networkd is pretty straightforward.

Your posts #1, #5 and #7 show that you tried to configure an IP address on an interface without a carrier (no cable attached) - which is not possible by default.

Your post #5 suggests you had NetworkManager running - make sure you only have one network management.

Your post #7 mentions "free.network" - what on earth is that?

Your post #11 shows you try to setup a bridge purely on it's own - that is not the purpose of a bridge. A bridge combines two or more physical or virtual interfaces on OSI level 2. The resulting bridge can be treated like a network interface - you may bind a service like a DHCP server to it.

So - what do you want to achieve with your bridge? Which interfaces should be combined?

Offline

#15 2024-03-27 18:00:44

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

in the documentation netdev it says:
Bridge: A bridge device is a software switch, and each of its slave devices and the bridge itself are ports of the switch

I want to connect wlan to br0. I want DHCPServer to work on br0.

10-br0.netdev

[NetDev]
Name=br0
Kind=bridge

10-wlan.network

[Match]
Name=wlan0

[Network]
DHCP=true
#Bridge=br0 #error Failed to set master interface: Device does not allow enslaving to a bridge. Operation not supported

10-br0.network

[Match]
Name=br0

[Network]
DHCPServer=true
#DHCP=true # example

#[Address]
#Address=192.168.123.1/24

I've tried playing with parameters, configuring routing, additional parameters. Everything is working. But I can't get br0 to set the local ip. ( I tried configuring [Address] and also tried to configure all this in [Network]). with normal interfaces everything works fine ( as there I just need to enable DHCP and that's it ).

Last edited by forward_one (2024-03-27 18:09:12)

Offline

#16 2024-03-27 20:11:53

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

Re: systemd-networkd ( .network ) not working

A wireless interface needs an association to an AP to be added to a bridge: https://wiki.archlinux.org/title/Networ … n_a_bridge

A bridge member needs no IP address/configuration.

[Match]
Name=wlan0

[Network]
Bridge=br0

Offline

#17 2024-03-27 20:18:27

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

-thc wrote:
[Match]
Name=wlan0

[Network]
Bridge=br0

wlan0: Failed to set master interface: Device does not allow enslaving to a bridge. Operation not supported

Offline

#18 2024-03-27 20:33:30

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

Damn it. I'm so stupid. I'm so sorry. It works. You have to have a second device connected for the bridge to work.

Offline

#19 2024-03-27 20:35:29

forward_one
Member
Registered: 2023-06-30
Posts: 32

Re: systemd-networkd ( .network ) not working

-

Last edited by forward_one (2024-03-27 20:40:36)

Offline

Board footer

Powered by FluxBB