Solaris static routes are still commonly used static routes. So I studied how to add permanent routes under solaris static routes. Here I will share with you, I hope it will be useful to you. The most common solaris static route is a host to a local router, which is usually defined in/etc/defaultrouter to add a gateway.
You can also use the in. routed is defined in the file/etc/gateways. When solaris is used for static routing, the route table in the kernel is defined at system startup and usually does not change, unless modified using the route or ifconfig command. When the local network is connected to the rest of the Internet through a single gateway, solaris Static Routing is the most suitable choice. Solaris static routes can be manually added using route or ifconfig. After being generated, the route table is retained. If dynamic routing is used, the route table is often changed after restart, the daemon process should be responsible for handling vro configuration and available route changes.
Kernel route table
1. Host Routing-map one host to another host on the local network
Commandformat:
Routeadd-hostdestination_iplocal_ip-interfaceinterface
For example, we want to add a route between the local host interface hme0 (204.12.17.1) and another host (204.12.16.100) on the adjacent Class C network:
# Routeadd-host204.12.16.100204.12.17.1-interfacehme0
2. network routing-allow data packets to be transmitted from the local host to other hosts on the local network
Commandformat:
Routeadd-netdestination_network_iplocal_ip-netmaskmask
If we want to add a route (204.12.16.0 Network) between the local host (204.12.17.1) and the network we mentioned above for the class C netmask, we can use the following command:
# Routeadd-net204.12.16.0204.12.17.1-netmask255.255.255.0
3. The default route transmits the task of finding a route to a vro. Both the RIP and RDISC daemon can use the default route.
Commandformat:
Routeadddefaulthostname-interfaceinterface
Eg: Add a default route entry to the local router (204.54.56.1), which is usually used to add a gateway and takes effect immediately.
# Routeadddefa20204.54.56.1-interfacehme1
Dynamic Routing
Solaris supports the routing information protocol (RIP) and the routing Discovery Protocol (RDISC. the routed daemon is usually configured to start when multiple users start. The routing daemon always establishes a route table that can reach each network. The host uses the RDISC daemon (in. rdisc) to collect available routing information from the router. In. rdisc usually creates a default route for every solaris static route in response to the request. Note: To enable dynamic routing, the file/etc/defaultrouter must be empty.
The in. routed process starts a line in/etc/rc2.d/S69inet by running the following command.
#/Usr/sbin/in. routed-q after initialization, the routing daemon checks the gateway specified in the/etc/gateways file.
#/Usr/sbin/in. routed-S.