Solaris UNIX Add Static Routes

www.la‮.iruttu‬com
Solaris UNIX Add Static Routes

To add static routes on a Solaris UNIX system, you can use the route command.

  1. To add a route to a specific network, use the following syntax:
route add -net NETWORK_ADDRESS GATEWAY_ADDRESS

For example, to add a route to the network 192.168.1.0 with a gateway of 192.168.1.1, you would run:

route add -net 192.168.1.0 192.168.1.1
  1. To add a route to a specific host, use the following syntax:
route add -host HOST_ADDRESS GATEWAY_ADDRESS

For example, to add a route to the host 192.168.1.10 with a gateway of 192.168.1.1, you would run:

route add -host 192.168.1.10 192.168.1.1
  1. To make the changes persistent across reboots, you will need to add the routes to the /etc/defaultrouter file. For example, to add the routes from the previous examples, you would add the following lines to the file:
192.168.1.1
192.168.1.1
  1. To view the current routing table, use the route -n command. This will show you the destination, gateway, and flags for each route.
Created Time:2017-10-30 14:27:19  Author:lautturi