For When You Can't Have The Real Thing
[ start | index | login ]
start > Fedora > 34 > Permanent Static Routing

Permanent Static Routing

Created by dave. Last edited by dave, 2 years and 308 days ago. Viewed 2,119 times. #2
[diff] [history] [edit] [rdf]


How do we set a static route entry to take effect at boot time without custom script fuckery like rc.local?


For routes with an actual destination, you add them using Network Manager's nmcli:

# nmcli con mod eth0 ipv4.routes ""
# nmcli con mod eth0 +ipv4.routes ""

If you are looking to add routes without a real destination ie a blackhole route, you have to use custom script fuckery in /etc/NetworkManager/dispatcher.d/pre-up.d, for example an executable file named 50-blackholes:

ip route add blackhole
ip route add blackhole
ip route add blackhole


Yeah yeah this could also be done with firewalld, but who really wants to open that can of worms? My sketch is that this is a box that could be anywhere in the network but might have snmp targets configured from previous locations which would cause a bunch of wasted network traffic. The local, and default, rules are directly present so for the internet and local-net traffic a blanket blackhole covers the rest until someone can get in and reconfigure the monitors.

According to the Fedora documentation since at least Fedora 28, we don't do routing in Fedora. It isn't in the system admin guide at all.

If you dig around you'll eventually notice the ipv4.routes parameter in nmcli profiles, and googling that will get you a RHEL page describing how it works.

Blackhole routing seems to only be described >>here, in a CentOS bug report.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt