You are not logged in.
Pages: 1
Hi, I created a file 30-ipforward.conf according to the wiki: https://wiki.archlinux.org/title/Internet_sharing
/etc/sysctl.d/30-ipforward.conf
net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
After restarting the pc/router, the settings, however, are not applied for my interface eno1, eno2, eno3 and eno4:
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.eno1.forwarding = 0
net.ipv6.conf.eno2.forwarding = 0
net.ipv6.conf.eno3.forwarding = 0
net.ipv6.conf.eno4.forwarding = 0
net.ipv6.conf.lo.forwarding = 1
If I enter the command sysctl --system it will be set. What could it be? Is it applied at boot before the enoX interfaces are configured?
root@router ~ # sysctl --system
* Applying /usr/lib/sysctl.d/10-arch.conf ...
fs.inotify.max_user_instances = 1024
fs.inotify.max_user_watches = 524288
* Applying /etc/sysctl.d/30-ipforward.conf ...
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
* Applying /usr/lib/sysctl.d/50-coredump.conf ...
kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
kernel.core_pipe_limit = 16
fs.suid_dumpable = 2
* Applying /usr/lib/sysctl.d/50-default.conf ...
kernel.sysrq = 16
kernel.core_uses_pid = 1
net.ipv4.conf.default.rp_filter = 2
sysctl: setting key "net.ipv4.conf.all.rp_filter": Invalid argument
net.ipv4.conf.default.accept_source_route = 0
sysctl: setting key "net.ipv4.conf.all.accept_source_route": Invalid argument
net.ipv4.conf.default.promote_secondaries = 1
sysctl: setting key "net.ipv4.conf.all.promote_secondaries": Invalid argument
net.ipv4.ping_group_range = 0 2147483647
net.core.default_qdisc = fq_codel
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
fs.protected_regular = 1
fs.protected_fifos = 1
* Applying /usr/lib/sysctl.d/50-pid-max.conf ...
kernel.pid_max = 4194304
and now:
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.eno1.forwarding = 1
net.ipv6.conf.eno2.forwarding = 1
net.ipv6.conf.eno3.forwarding = 1
net.ipv6.conf.eno4.forwarding = 1
net.ipv6.conf.lo.forwarding = 1
What am I doing wrong? Otherwise I use NetworkManager.
Thanks
Last edited by vecino (2023-05-23 15:31:05)
Offline
I'm sure it's because at the time the systemd-sysctl.service is started the network interfaces eno1, eno2, eno3 and eno4 don't exist yet.
I tried adding the following to /etc/sysctl.d/30-ipforward.conf:
net.ipv6.conf.eno1.forwarding = 1
and
May 12 13:58:50 router systemd-sysctl[221]: Couldn't write '1' to 'net/ipv6/conf/eno1/forwarding', ignoring: No such file or directory
What would you recommend as the simplest solution?
Offline
I solved it via NetworkManager-dispatcher. Which runs when the state of interfaces /usr/bin/sysctl --system changes.
Offline
Pages: 1