How can we perform a valid solaris static route? What should I pay special attention to When configuring solaris Static Routing? Next we will give a comprehensive explanation of these issues. We all know that to add a default route in solaris, you only need to edit the vi/etc/defaultrouter file. The content is your default gateway.
The command route can be used to add solaris static routes. For specific parameters, see manual of route (1. The following is a simple example of adding or deleting a solaris static route. After execution, the route table takes effect immediately. You can run the command # netstat-r to view the route table. However, after the system restarts, it will become invalid. That is to say, after restarting the system, I need to re-run the routeadd command. To save this trouble, we can compile a script to run the command automatically after the system is started. This is also the idea of solution Below.
Solaris static route solutionA:
Edit the file solutionA under/etc/init. d.
The content is routeadd-netdestinationnext-specified metric.
Then chmod0777/etc/init. d/solutionA makes the file executable.
Then, lnsolutionA/etc/rc2.d/S100solutionA under/etc/init. d/enables solutionA to be started after the system is started.
Solaris static route solutionB:
ViS100solutionB under/etc/rc2.d
The content is routeadd-netdestinationnext-specified metric.
In comparison, solutionA is better.
Solaris static route solutionC:
Edit the/etc/gateways file.
File Format
Netdest. netgatewayroutermetriccnt [passive] [active]
For example:
Net128.50.0.0gatewaysword-rmetric1passive
Use
Host128.50.0.0gatewaysword-rmetric1passive
How to add a default static route
Edit the/etc/defaultrouter content to the default IP address of the gateway.