Hi all,
I’m new to OpenSuse, but i have been using linux for about 10 years, usually using redhat based distro.
I would like to tweak some /proc/sys/network/conf parameters and i tryed to do this permanently by adding some lines to /etc/sysctl.conf, but this seems to have no effect on the system.
I thought this was caused by something which happens later in the boot sequence, reverting my modifications to the default, so i added some line in /etc/init.d/after.local, without any effect.
At last I added a very simple “touch /root/test.txt” as last line of after.local, but after the reboot no test.txt was present in /root/
At this point a was totally confused! My question are : what is the right way to do some permanent modification to sysctl parameters ? And Is after.local scrpts really executed at boot ?
> I thought this was caused by something which happens later in the boot
> sequence, reverting my modifications to the default, so i added some
> line in /etc/init.d/after.local, without any effect.
Hum. With the new systemd after.local is not supported, because they say
that there is no valid definition of when is “after”.
I think that “/etc/init.d/boot.local” works, but I forget how you can
enable it. And it may not happen at a point appropriate for network
changes. But the network files has, I believe, hooks to add scripts: I
would look at “/etc/sysconfig/network/if-up.d/”.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
Hi,
the parameters i would like to tune are in /proc/sys/net/ipv4/conf/<ifname>/, i made a mistake in my previus post.
I have already tried to write into /proc/sys/… using sysctl -w and echo “value” > /proc/the/file/you/want and, of course, it worked fine. I also issued a sysctl --system and all the modification in sysctl.conf were instantly applied. What I’m unable to do for now it’s to have this tuning done at boot time.
Working on sysctl.conf has not worked, probably due to some subsequent service scripts overwriting them
inserting some echo “xxx” > yyy in boot.local does not work
inserting some echo “xxx” > yyy in after.local does not work and a discovered that this script is never executed
I have just tried to add a ifsysctl-br0 file in /etc/sysconfig/network but also this does not work! this looks like a bug, ifsysctl file shoud be interpreted by the /etc/sysconfig/network/scripts/ifup-sysctl script each time a new network interface is created. I verified that ifupsysctl is really launched, but for some reasons ifsysctl-br0 is not interpreted.
How is possible ? I really don’t know what else I can do.
sysctls for specific interface should be applied by udev rule when interface appears:
/lib/udev/rules.d/99-systemd.rules:# Apply sysctl variables to network devices (and only to those) as they appear.
/lib/udev/rules.d/99-systemd.rules:SUBSYSTEM=="net", KERNEL!="lo", RUN+="/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/$name --prefix=/proc/sys/net/ipv4/neigh/$name --prefix=/proc/sys/net/ipv6/conf/$name --prefix=/proc/sys/net/ipv6/neigh/$name"
Are your values when you manually run this command? Is your interface listed under /sys/class/net? What is exact names of sysctls you are trying to set?
the command sysctl --system, manually launched, works fine.
I manually executed the command you suggest:
/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/eth0 --prefix=/proc/sys/net/ipv4/neigh/eth0 --prefix=/proc/sys/net/ipv6/conf/eth0 --prefix=/proc/sys/net/ipv6/neigh/eth0
Yesterday I did a mistake: I issued the command you suggested, after configuring only the /etc/sysconfig/network/ifsysctl-eth0, while /etc/sysctl.d/ was left empty.
Now, after configuring sysctl.conf or sysctl.d/test_sysctl.conf, the command have had the expected behavior.
So now we know that the systemd-sysctl script is working fine if I launch it on a live system, but i still can’t explain why it’s not working at boot!
I also can’t explain why the ifsysctl-<devname> way is not working
Did you read my paper at the link in my previous pot?
In it
I referenced the original source which wrote directly to the /proc/network scripts, acknowleged that method works and stated why I “improved” by changing the steps to use sysctl
I described how to use sysctrl from the CLI
I described how to persist the sysctl commands between boots.
I just tested it in 12.3 RC1 and it works. So either we face a bug in 12.2 or something changes settings after they are applied when interface first appears.
Thank you Tsu, i read your paper, but that’s not the point. I’m able to change sysctl at runtime, the problem is in how to persist those settings between boots using native OpenSuse way, like sysctl.conf or ifsysctl-<devname> files that are supposed to do that job.
I did some more tests on a different machine (different hw, different Ethernet driver) , XEN and VMWare are not installed.
The result is that it’s impossible to change network related sysctl settings using /etc/sysctl.conf or /etc/sysconfig/network/ifsysctl-<devname>
I’m seriously considering to open a bug. I don’t know what else i could try. Any ideas ?
Could someone of you make a simple test to confirm the bug ?
Don’t know why you are trying to change the settings where you are. Can’t you just set the network up as you want in Yast? Though it is unclear what you are really trying to actually do.
Read the first sentence on this page, then everything else, particularly how the multi-line config is created towards the bottom of this page
It’s the standard cross-distro method using sysctl (systemV), will work for any distro and version using systemV including 12.2. I haven’t tested how well it might work in more fully systemd systems like 12.3 although theoretically it <should> still work.