Give the route a name

With Oracle Solaris 11.4 you are now able to give routes a name, thus making easier to refer to them in the route command. Let’s create a route in the system, however we add an option to the normal command so it will have a name.

root@sol114s1:~# route -p add 10.0.20.1/24 192.168.1.1 -name narf
add net -name narf 10.0.20.1/24: gateway 192.168.1.1

Now we can refer to this route by using the name narf. For example to view the details.

root@sol114s1:~# route get -name narf
   route to: 10.0.20.1
       name: narf
destination: 10.0.20.0
       mask: 255.255.255.0
    gateway: 192.168.1.1
  interface: net0
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh    rtt,ms rttvar,ms  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0

You can use it as well for deleting it.

root@sol114s1:~# route delete -name narf
delete net -name narf 10.0.20.1/24: gateway 192.168.1.1

With a consistent naming scheme on all your systems you can definitely make your life easier here when you work with routes.