LKSF › Solaris Networking › Boot persistent routes
When you work with the interesting features of Solaris, you forget about the small features in commands you use day by day. In my IPMP tutorial I used an SMF script to make some host routes persistent … at foremost to show you that SMF scripts are really easy. But, well … this script isn’t necessary because of the -p option of the route add command.
Using the -p option makes the route boot persistent:
jmoekamp@hivemind:~# route -p add -host 192.168.2.3 192.168.2.3 -static
add host 192.168.2.3: gateway 192.168.2.3
add persistent host 192.168.2.3: gateway 192.168.2.3
At first the command tries to configure the route in the live system. When this step was successful, it makes the route boot persistent.
You can check the routes already made persistent by using the route -p show command:
jmoekamp@hivemind:~# route -p show
persistent: route add -host 192.168.2.3 192.168.2.3 -static
The routes are written into the /etc/inet/static_routes file:
jmoekamp@hivemind:/etc/inet# cat static_routes
# File generated by route(1M) - do not edit.
-host 192.168.2.3 192.168.2.3 -static
Every line that isn’t empty or commented will be prepended with route add and executed at startup. The code responsible for this task is in the method script /lib/svc/method/net-routing-setup, which is used by the SMF service svc:/network/routing-setup.
Deletion of a persistent route is easy, too. Just use the route delete command with a -p:
jmoekamp@hivemind:/etc/inet# route -p delete -host 192.168.2.3 192.168.2.3 -static
delete host 192.168.2.3: gateway 192.168.2.3
delete persistent host 192.168.2.3: gateway 192.168.2.3
(orthography/syntax review 2026-04-12)