Solaris: Routers
Specify a Router for the Network Client
- If you have only one router on the network and you want the network configuration server to specify its name automatically, ensure that the network client does not have a /etc/defaultrouter file.
- To override the name of the default router provided by the network configuration server:
- Create /etc/defaultrouter on the network client.
- Type the host name and IP address of the machine you have designated as the default router.
- Add the host name and IP address of the designated default router to the network client's /etc/inet/hosts.
- If you have multiple routers on the network, create /etc/defaultrouter on the network client, but leave it empty.
Creating /etc/defaultrouter and leaving it empty causes one of the two dynamic routing protocols to run: ICMP Router Discovery protocol (RDISC), or Routing Information Protocol (RIP). The system first runs the program in.rdisc, which looks for routers that are running the router discovery protocol. If it finds one such router, in.rdisc continues to run and keeps track of the routers that are running the RDISC protocol.
- If the system discovers that routers are not responding to the RDISC protocol, it uses RIP and runs the daemon in.routed to keep track of them.
 
Configuring Routers
TCP/IP's first requirement for a router is that the machine must have at least two network interfaces installed, as introduced in Network Interfaces. As long as one of the network interfaces is not disabled, the router automatically "talks" to the RDISC and RIP protocols. These protocols keep track of routers on the network and advertise the router to the hosts on the network.
After the router is physically installed on the network, configure it to operate in local files mode, as described in How to Configure a Host for Local Files Mode. This ensures that routers will boot in case the network configuration server is down. Remember that, unlike a host, a router has at least two interfaces to configure.
Configuring Both Router Network Interfaces
Because a router provides the interface between two or more networks, assign a unique name and IP address to each of the router's network interface cards. Thus, each router has a host name and IP address associated with its primary network interface, plus at least one more unique name and IP address for each additional network interface.
How to Configure a Machine as a Router
- Become superuser on the machine to be configured as a router.
- Create an /etc/hostname.interface file for each network interface installed. For example, create hostname.ie0 and hostname.ie1. (See /etc/hostname. interface File for more information.) If you are using IPv6, see IPv6 Network Interface Configuration File.
- In each file, type the host name you have selected for that interface. For example, you could type the name timbuktu in the file hostname.ie0, then type the name timbuktu-201 in the file hostname.ie1. Both interfaces would be located on the same machine.
- Type the host name and IP address of each interface into /etc/inet/hosts. For example:
192.9.200.20 timbuktu #interface for network 192.9.200 192.9.201.20 timbuktu-201 #interface for network 192.9.201 192.9.200.9 gobi 192.9.200.10 mojave 192.9.200.110 saltlake 192.9.200.12 chileanThe interfaces timbuktu and timbuktu-201 are on the same machine. Notice that the network address for timbuktu-201 is different from that of timbuktu. That is because the medium for network 192.9.201 is connected to the timbuktu-201 network interface while the media for network 192.9.200 is connected to the timbuktu interface. If you are using IPv6, see /etc/inet/ipnodes File.
- If the router is connected to any subnetted network, edit /etc/inet/netmasks and type the local network number (129.9.0.0, for example) and associated netmask number (255.255.255.0, for example).
The startup script determines whether to start up a routing protocol (RIP or RDISC) on the machine or use static routing.
How to Select Static Routing on a Host That Is a Nework Client
- Become superuser on the host.
- Add an entry for a router on the network into the /etc/defaultrouter file. See /etc/defaultrouter File. A single static default route is then installed in the routing table. Under this condition, the host does not run any dynamic routing protocol (such as RIP and RDISC).
How to Select Dynamic Routing on a Host That Is a Nework Client
- Become superuser on the host.
- Ensure that the /etc/defaultrouter file is empty. If it is empty, this forces a network client to select a dynamic routing protocol.
- The type of dynamic routing used is selected according to the following criteria:
- If the /usr/sbin/in.rdisc program exists, the startup script starts in.rdisc. Any router on the network that is running RDISC then responds to any RDISC queries from the host. If at least one router responds, the host selects RDISC as its routing protocol.
- If the network router is not running RDISC or fails to respond to the RDISC queries, then in.rdisc on the host exits. The host then starts in.routed, which runs RIP.
How to Force a Machine to Be a Router
You can force a machine that has only one /etc/hostname.interface file (by default a host) to be a router.
- Become superuser on the machine.
- Create a file named /etc/gateways and leave it empty. This is important if you decide to configure PPP links, as explained in Routing Considerations