You are not logged in.

#1 2023-01-15 12:50:44

vecino
Member
Registered: 2022-12-10
Posts: 139

[SOLVED] NetworkManager and sysctl

Hi, can someone please help me understand why NetworkManager ignores the setting from /etc/sysctl.d/99-sysctl.conf ? Only ipv6 forwarding is problem.

[root@home ~]# cat /etc/sysctl.d/99-sysctl.conf
# Forward
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
...

But it does not apply to my interfaces after reboot:

[root@home ~]# sysctl net.ipv6.conf.*****.forwarding
net.ipv6.conf.enp1s0.forwarding = 0
net.ipv6.conf.enp2s0.forwarding = 0
net.ipv6.conf.enp3s0.forwarding = 0
net.ipv6.conf.vlan102.forwarding = 0
...

I have to run sysctl --system or sysctl -p /etc/sysctl.d/99-sysctl.conf.

What do you think is the best solution? Set up via NetworkManager-dispatcher.service like:

/etc/NetworkManager/dispatcher.d/00-sysctl

net.ipv6.conf.enp1s0.forwarding = 1
net.ipv6.conf.enp2s0.forwarding = 1
net.ipv6.conf.enp3s0.forwarding = 1
net.ipv6.conf.vlan102.forwarding = 1
...

Any ideas? Thank you


btw: This is the real cause of my problem here: [SOLVED] Network Manager drop ssh connection

Last edited by vecino (2023-01-18 15:10:45)

Offline

#2 2023-01-18 12:22:41

vecino
Member
Registered: 2022-12-10
Posts: 139

Re: [SOLVED] NetworkManager and sysctl

I currently solving it this way - I haven't come up with a better option.

Created file: /etc/NetworkManager/dispatcher.d/00-sysctl (chmod + 755)

#!/bin/sh

/usr/bin/sysctl --system

exit 0

It is applied at every change to the interfaces.


NetworkManager-dispatcher - Dispatch user scripts for NetworkManager

Offline

Board footer

Powered by FluxBB