|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
Routing is the process of forwarding a packet from one computer to another. It is based on an address in the message’s layer-3 header. But there’s more involved than just reading a layer-3 address, though.
The Solaris IP stack maintains a special database called a routing table. When Solaris forwards a packet, it first refers to the routing table to decided where to send the packet. If the host tries to connect to a host which is the same network it just sends packet to the destination (direct routing). If the target host is on another network than host's own, then it sends the data to the router (indirect routing). Often only one router is defined as the 'default gateway'. In this case from the host’s point of view it outsources all the processing of "non-local" packets to this gateway. If there is no default gateway and the router doesn’t find an entry in its routing table that matches the destination network address, the router discards the packet.
The Solaris route command enables manual manipulation of the route table. The routing table contains a list of networks that the router knows it can send packets to, and states over which link to send the packets. These can be static routes, (entered by a system administrator) they can be default routes (a special static route to send unknown destination IP addresses to), or they can be dynamically discovered routes, found using a routing protocol. In case of dynamic routing routers talk to each other and share information about networks they are connected to. That sounds scary and it really is. It also creates the infinite possibilities of misunderstanding. At the same time, dynamic routing takes the building of the routing table out of your hands and puts it into the hands of specific routing protocol. Your job then becomes the monitoring of the routing tables to make sure that the routers are playing nicely with each other. See Routing for more details.
Route command gives the possibility to specify static routes. The syntax of the command is somewhat complicated:
route [-fn] add | delete | get [net|host|default] [destination] [gateway]
With keywords add and delete the default for optional [net|host|default] troika is host.
Here are some examples that might help to learn the intricacies of the command:
Notes:
As we already discussed there are two types of routing:
A default route is a route table entry that allows a host to define default routers to use if no other specific route is available. The default routers must be reliable. There is no need to define every reachable network. All indirectly connected packet destinations go to the default router.
A default router is identified by entries in /etc/defaultrouter. It contains hostname or IP address entries that correspond to one or more routers. Upon rebooting, this prevents the startup script (/etc/rc2.d/S69inet) from launching the in.routed and in.rdisc dynamic router processes. Default route table entries may also be added by the in.rdisc daemon.
Advantages of default routing are:
Disadvantages of default routing:
Q1. Which command manipulates the routing table ?
A: route
Q2: Command to add a route to server1 via router1:
A: route add host server1 router1
Q3. Which command will add a route to the network 128.251.0.0 via 128.144.1.254 ?
A: route add net 128.251.0.0 128.144.1.254
Q4. Which command would delete a route to host server1 via router1 ?
A: route delete host server1 router1
Q5. Which command will delete the route to the network 128.251.0.0 via 128.144.1.254 ?
A: route delete net 128.251.0.0 128.144.1.254
Q6. Which command will remove all entries from the routing table ?
A: route flush
Q7. Which command allows you to monitor the routing requests that are not getting resolved from the routing table ?
A7: route monitor
Q8. Which script starts the in.named daemon ?
A: Depend on the Solaris version:
/etc/init.d/inetsvc
|
|||||||
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: August 09, 2009