Setting up subnets and routing

Specifying a default router

If there are only one or two routers connected to a local network, you can make clients direct all outward bound packets to one router. This is known as the default router. When the default router receives packets which it needs to redirect to another router on the same subnet, it sends ICMP routing-redirect messages to the source host. This allows the hosts to adjust their routing tables dynamically so that they will subsequently use the correct router.

This approach yields a limited advantage in terms of performance over running a routed or gated routing daemon on each host, but it is unsuitable in an environment where subnets are only connected by bridges. This is because bridges do not generate ICMP routing-redirect messages. Further, if the default router goes down, there is no way to maintain service except to alter the routing tables on each host manually using the route(1Mtcp) command.

You can also use the route to prime the hosts' routing tables with static routes. Once you do this, you no longer have dynamic routing. This may not be the best choice if it is possible that you may add other routers or change the network topology in the future.

To specify a default router:

  1. Add an entry of the following form to the file /etc/inet/config (or edit an existing entry) on the client:
    sort-key:/usr/sbin/route::y::add default router:
    
    Substitute the IP address or host name of the router on your local network for router. Ensure that the flag field contains the value ``y'' to enable the entry.

  2. Disable the routed daemon by replacing the value ``y'' in the flag field of the entry for /usr/sbin/in.routed with the value ``n''. The entry should now read:
    sort-key:/usr/sbin/in.routed:/usr/sbin/in.gated:n:::
    

  3. Shut down and reboot the host system.
For example, networks named eng and mktg are connected by a router. The router has two network interfaces, one for each network, and each interface has a different host name. On the network named eng, the router's host name is jekyll; on mktg, its name is hyde.

If your client is on the eng network, the entry for /usr/sbin/route in its /etc/inet/config file would be:

   sort-key:/usr/sbin/route::y:add default jekyll:
If your client is on the mktg network, the entry in /usr/sbin/route would be:
   sort-key:/usr/sbin/route::y:add default hyde:
In both examples, the argument default indicates that all communication directed outside the local network from your client will be directed through the router.
© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999