You are not logged in.

#1 2024-05-17 07:16:10

FishBoneEK
Member
Registered: 2023-09-26
Posts: 60

[SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

Hello!
I'd like to turn the net/ipv4/ip_forward on, and in my /etc/sysctl.d/50-forward.conf:

net.ipv4.ip_forward=1

Also "systemd-analyze cat-config sysctl.d | grep ip_forward" shows:

net.ipv4.ip_forward=1

However on every boot I can see the ip forward option is still turned off. It seems it's overridden by something.
If I remembered correctly, my config used to work until weeks ago.
Suggestion? Thanks!

EDIT:
Problem resolved, it's one of my proxy program which supports setting IP forward via its interface. Perhaps I set if off some time ago, so it sets ip_forward to 0 at boot time.

Last edited by FishBoneEK (2024-05-18 08:23:13)

Offline

#2 2024-05-17 07:24:27

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,653
Website

Re: [SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

If it's not overridden by any config, some kind of program or script must be invoking sysctl and reset the value.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2024-05-17 11:13:01

FishBoneEK
Member
Registered: 2023-09-26
Posts: 60

Re: [SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

schard wrote:

If it's not overridden by any config, some kind of program or script must be invoking sysctl and reset the value.

Yeah I know, but I don't know what program or script it is

Offline

#4 2024-05-17 11:21:06

edacval
Member
From: .LT
Registered: 2008-10-23
Posts: 98

Re: [SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

Are you using systemd-networkd for network configuration ?

Offline

#5 2024-05-17 15:09:16

FishBoneEK
Member
Registered: 2023-09-26
Posts: 60

Re: [SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

edacval wrote:

Are you using systemd-networkd for network configuration ?

No, I use NetworkManager. Plus I have an AP connection set up, it connects automatically.

Offline

#6 2024-05-17 18:39:51

loqs
Member
Registered: 2014-03-06
Posts: 18,911

Re: [SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

Is the value changed after manually running systemd-sysctl to apply that config?

# /usr/lib/systemd/systemd-sysctl 50-forward.conf

Offline

#7 2024-05-18 08:24:14

FishBoneEK
Member
Registered: 2023-09-26
Posts: 60

Re: [SOLVED] net/ipv4/ip_forward is overridden even if it's in config file

loqs wrote:

Is the value changed after manually running systemd-sysctl to apply that config?

# /usr/lib/systemd/systemd-sysctl 50-forward.conf

Thanks for the help. I just solved it. You can check the updated post for the result.

Offline

Board footer

Powered by FluxBB