Rocky 9 networking

On rocky 9 i have a system with its network connections set through /etc/NetworkManager/system-connections/

When i manually edited the keyfile in this location directly nothing happens after reloading systemctl NetworkManger .

I want to be able to do this or find a file that i can change networking setting as I’ll then create a script in my kickstart to add static network info to loads of machines.

Currenly on rocky 8 it works as expected but with rocky 9 networking is different.

I added mtu=9000 on the keyfile and nothing happened after rebooting NetworkManager. I had to add it via
ip link set mtu 9000 dev ens192
But after reboot it went back to mtu 1500.

If I modify connection manually, then I do it with nmcli – not files. You could probably call nmcli in your %post.

However, the network command in kickstart does have --mtu option. Shouldn’t that be the first thing to try? Appendix B. Kickstart commands and options reference Red Hat Enterprise Linux 9 | Red Hat Customer Portal


My standard install does only minimal. Kickstart is mainly inserting SSH key for root so that I can log in after install. Then I run ansible playbook that may use rhel-system-roles.network to configure network. https://access.redhat.com/articles/3050101

You should be trying to run nmcli con reload. That forces Network Manager to re-read connection profiles. Additionally, nmcli con down and then nmcli con up would help too.

Two other things. If you’re going to put mtu manually in your connection profiles, you need to put it under [ethernet]. Example.

. . .
[ethernet]
mtu=1500

[bridge]
stp=false

[ipv4]
. . .

Lastly, it’ll be better to use nmcli to do your work. Run nmcli con show and your interface name and look for mtu. You’ll find that it’s 802-3-ethernet.mtu. Running nmcli con mod NAME 802-3-ethernet.mtu would help you set the value.

As an aside, since you want to do this in a kickstart, you may want to review the RHEL 9 documentation linked in the post before mine to help you too.

Thank you all for your help. I will check the documentation out next week and test implementation. Thanks again.

I added the mtu=9000 in the ethernet section then ran

nmcli con mod ens192 ens192 802-3-ethernet.mtu “9000”
Then I ran ifconfig to check if value had not changed and it was still set to 1500.

After restarting the network manager service this worked and even after reboot my mtu is 9000.

systemctl restart NetworkManager

nmcli con down ens192 ; nmcli con up ens192

might also do the trick (i.e. push new settings to kernel).


Seems redundant. The

nmcli con mod ens192 802-3-ethernet.mtu 9000

should ensure on its own that proper section of the correct file has the “mtu=9000”.
But, if proper section of the correct file already has the “mtu=9000” (via manual edit),
then you don’t need to write it with nmcli (again).

1 Like

This worked. Thanks. Have amended my script to use the new commands.