Innerhalb
Nach weiteren Dokumenten suchen
Support-Ressourcen
| Dieses Buch im PDF-Format herunterladen
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" on page 6. Its. As long as one of the network interfaces is not disabled, the router will automatically "talk" 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" on page 70. This assures 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
- Since a router provides the interface between two or more networks, you must assign a unique name and IP address to each of the router's network interface cards. Thus, each router will have 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 that will be configured as a router and do the following:
-
-
Create an /etc/hostname.interface file or each network interface installed.
For example, create hostname.ie0 and hostname.ie1. (See "/etc/hostname.interface File" on page 49 for more information.)
-
Type in each file the host name you have selected for that interface.
For example, you could type the name timbuktu in the file hostname.ie0 and 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:
-
# These machines are in the SPEC lab
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 chilean
|
- The interfaces timbuktu and timbuktu-201 are on the same machine. Note that the network address for timbuktu-201 is different than 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 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).
How a Machine Determines If It Is a Router
- The /etc/rc2.d/S69inet startup script, which runs when the machine boots, determines whether a machine is a router or a host. This decision also determines whether the routing protocols (RIP and RDISC) should run in router mode or host mode.
- The /etc/rc2.d/S69inet script concludes that a machine is a router if the following two conditions exist:
-
- More than one /etc/hostname.interface file exists.
- More than one interface was configured "up" by the ifconfig command. (See the ifconfig(1M) man page).
- If only one interface is found, the script concludes that the machine is a host. See "Configuring Both Router Network Interfaces" on page 79. Any interface that is configured by any means other than an /etc/hostname.interface file will not be taken into account.
Automatic Routing Protocol Selection
- The startup script then must determine whether to start up a routing protocol (RIP or RDISC) on the machine or use static routing
-
To Select Static Routing on a Host If the host is a diskless client or network client, you simply add an entry for a router on the network into /etc/defaultrouter. (See "/etc/defaultrouter File" on page 50.) A single static default route is then installed in the routing table. Under this condition, the host will not run any dynamic routing protocol (such as RIP and RDISC).
-
To Select Dynamic Routing on a Host To force a diskless client or network client to select a dynamic routing protocol, its /etc/defaultrouter file should be empty. The type of dynamic routing used is selected according to the following criteria:
-
- If the /usr/sbin/in.rdisc program exists, the startup script will start in.rdisc. Any router on the network that is running RDISC will then respond to any RDISC queries from the host. If at least one router responds, the host will select 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.
Forcing 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. To do so, 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" on page 122.
Forcing a Machine to Be a Host--the "Firewall" Gateway
- For security reasons, you may wish to create what is known as a nonrouting router, called a firewall gateway. When configured as a firewall, a machine cannot pass packets between the networks attached to it. On the other hand, it can still provide standard TCP/IP services, such as telnet or rlogin, to authorized users.
· How to Force a Router to Be a Host
- You can force a machine that has two or more /etc/hostname.interface files (by default a router) to be a host.
-
-
Edit /etc/rc2.d/S69inet.
-
Comment out the following two lines.
-
numifs=`ifconfig -au | grep inet | wc -1`
numptptifs=`ifconfig -au | grep inet | egrep -e ' -->' | wc -1`
|
-
-
Add the lines numifs=1 and numptptifs=0. The completed file will resemble:
-
#numifs=`ifconfig -au | grep inet | wc -1`
#numptptifs=`ifconfig -au | grep inet | egrep -e ' -->' | wc -1`
numifs=1
numptptifs=0
|
Turning On Space-Saving Mode
- Space-saving mode provides the host with a table that contains only the default routes. On a host, in.routed runs with space saving mode turned off by default.
- If you do not want the host to have a full routing table (which provides increased protection against misconfigured routers), turn space saving mode on. To do so, edit the /etc/rc2.d/S69inet startup script by changing the line:
-
-
/usr/sbin/in.routed -q
- to
-
-
/usr/sbin/in.routed -q -S
Turning Off ICMP Router Discovery on the Host
- For reasons involving router reliability, you may not want your hosts to use RDISC. To turn RDISC off, change the name of the host's /usr/sbin/in.rdisc to some other name, such as /usr/sbin/in.rdisc.saved, and then reboot the host.
Turning Off ICMP Router Discovery on the Router
- If the automatic selection of RIP rather than RDISC by a host is to work reliably, the routers in the network (particularly those running RDISC) also must work reliably.
- If your routers are not running RDISC and you install a single Solaris router, by default all hosts connected to that router will rely on it alone. To have the hosts on that network use the other routers as well, turn off RDISC on the new router. To do this, change the name of the router's /usr/bin/in.rdisc file to some other file name and reboot the router.
|
|