Compaq TCP/IP Services for OpenVMS
Management


Previous Contents Index


Chapter 4
Configuring Routing

Routing allows traffic from your local network to reach its destination elsewhere on the internet. Hosts and gateways on a network use routing protocols to exchange and store routing information. Routing is the act of forwarding datagrams based on information stored in a routing table.

The TCP/IP Services product provides two types of routing: static and dynamic. This chapter reviews key routing concepts and describes:

4.1 Key Concepts

If the hosts on your network need to communicate with computers on other networks, a route through a gateway must be defined. All hosts and gateways on a network store information about routes in routing tables. With TCP/IP Services, routing tables are maintained in both dynamic and permanent memory.

You can define routes manually (static routing), or you can enable routing protocols that exchange information and build routing tables based on the information exchanged (dynamic routing).

4.1.1 Static Routing

Because static routing requires manual configuration, it is most useful when the number of gateways is limited and where routes do not change frequently. For information on manually configuring routing, see Section 4.2.

4.1.2 Dynamic Routing

Complex environments require a more flexible approach to routing than a static routing table provides. Routing protocols distribute information that reflect changing network conditions and update the routing table accordingly. Routing protocols can switch to a backup route when a primary route becomes unavailable and can determine the best route to a given destination.

Dynamic routing tables use information received by means of routing protocol updates; when routes change, the routing protocol provides information about the changes.

Routing daemons implement a routing policy, that is, the set of rules that specify which routes go into the routing table. A routing daemon writes routing messages to a routing socket, causing the kernel to add a new route, delete an existing route, or modify an existing route.

The kernel also generates routing messages that can be read by any routing socket when events occur that may be of interest to the process, for example, the interface has gone down or a redirect has been received.

TCP/IP Services implements two routing daemons: the Routing Daemon (ROUTED) and the Gateway Routing Daemon (GATED). The following sections provide more information.

4.1.2.1 Routing Daemon (ROUTED)

This daemon (pronounced route-dee) supports the Routing Information Protocol (RIP). When ROUTED starts, it issues routing update requests then listens for responses. A system configured to supply RIP information responds to the request with an update packet. The update packet contains destination addresses and routing metrics associated with each destination. After receiving a RIP update, the ROUTED uses the information to update its routing table.

To configure dynamic routing with ROUTED, see Section 4.3.

4.1.2.2 Gateway Routing Daemon (GATED)

This daemon (pronounced gate-de) supports interior and exterior gateway protocols. It obtains information from several routing protocols and selects the best routes based on that information. You can configure GATED to use one or more of the protocols described in Table 4-1.

Table 4-1 GATED Routing Protocols
Protocol RFC Description
Routing Information Protocol (RIP) Versions 1 and 2 RFC 1058, RFC 1723 RIP is a commonly used interior protocol that selects the route with the lowest metric (hop count) as the best route.
Open Shortest Path First (OSPF) Version 2 RFC 1583 Another interior routing protocol, OSPF is a link-state protocol (shortest path first) and better suited than RIP for use in complex networks with many routers.
Exterior Gateway Protocol (EGP) RFC 904 EGP exchanges reachability information between autonomous systems. An autonomous system is usually defined as a set of routers under a single administration, using an interior gateway protocol and common metric to route packets. Autonomous systems use exterior routing protocols to route packets to other autonomous systems.
Border Gateway Protocol (BGP) RFCs 1163, 1267, 1771 Like EGP, BGP exchanges reachability information between autonomous systems but supports nonhierarchical topologies. BGP uses path attributes to provide more information about each route. Path attributes can include, for example, administrative preferences based on political, organizational, or security considerations.
Router Discovery RFC 1256 This protocol is used to inform hosts of the availability of routers that it can send packets to, and to supplement a statically configured default router.

These routing protocols are configured in the GATED configuration file TCPIP$GATED.CONF. This file contains statements that control tracing options, select routing protocols, manage routing information, and manage independent system routing.

For information on configuring dynamic routing with GATED, see Section 4.4.

4.2 Configuring Static Routes

The first time you run the configuration procedure, TCPIP$CONFIG.COM, static routing is configured automatically. To manually configure static routing, use the CREATE ROUTE command to create an empty routes database file.

The default file name is SYS$COMMON:[SYSEXE]TCPIP$ROUTE.DAT. To specify a different name, define the systemwide logical name TCPIP$ROUTE.

Note

Do not enter the CREATE ROUTE command unless you intend to reconfigure your entire cluster.

4.2.1 Creating a Default Route

When TCP/IP is sending a packet, it consults the routing table to determine which interface is connected to the destination network. If the packet has a destination network address that is unknown, the packet is sent to the default router. The default route points at the default router. For example, if a router with address 16.20.0.173 is designated to route all packets between the local network and the rest of the world, then the default route can be set with the following command:


$ TCPIP SET ROUTE /DEFAULT /GATEWAY=16.20.0.173 

If TCP/IP Services is active, this affects the active routes database. To ensure this default route is available next time TCP/IP Services is started, the /PERMANENT qualifier must be used. For example:


$ TCPIP SET ROUTE /DEFAULT /GATEWAY=16.20.0.173 /PERMANENT 

Use the SET NOROUTE command to remove a route.

Or you can define the default route using the route UNIX command. In this case, to ensure the default route is recreated next time TCP/IP Services is started, add the command to SYS$STARTUP:TCPIP$SYSTARTUP.COM. For example, to create the same default route as defined above, use the following UNIX style command:


$ route add default 16.20.0.173 

To remove the route, enter the following command:


$ route delete default 16.20.0.173 

4.2.2 Manually Defining Static Routes

To create a static route, use the SET ROUTE command. The command has the following effects:

The SET ROUTE command requires the following information:

Compaq strongly recommends that you do not specify alias names with the destination parameter or the /GATEWAY=host qualifier.

To define a route to any host on a specific network, enter:


TCPIP> SET ROUTE network_IP_address /GATEWAY="gateway" /NETWORK 

To define a route to a specific host on a specific network, enter:


TCPIP> SET ROUTE remote_host /GATEWAY="gateway" 

4.2.2.1 Examples

  1. In the following example, the network is active. The SET ROUTE command adds a route to the volatile routes database. TCPIP starts directing communication for flamingo through gateway francolin .


    TCPIP> SET ROUTE "flamingo" /GATEWAY="francolin" 
    

  2. In the following example, the network is active. The SET ROUTE command defines a routing path in the volatile routes database. The command specifies that traffic for the network with IP address 128.30.0.0 uses gateway francolin .


    TCPIP> SET ROUTE 128.30.0.0 /NETWORK /GATEWAY="francolin" 
    

  3. In the following example, the network is not active. The SET ROUTE command adds the new route to the permanent routes database. The next time the product starts up, packets for NENE will go through a gateway called bird.of.paradise .


    TCPIP> SET ROUTE NENE /GATEWAY="bird.of.paradise" 
    

    At startup, the information in the permanent routes database, if any exists, is loaded into the volatile routes database. You can add permanent routes while the product is stopped or while it is running. If it is running, use the /PERMANENT qualifier.

  4. The following command permanently sets routing for host albatross to go through gateway birdygate .


    TCPIP> SET ROUTE "albatross" /GATEWAY="birdygate" /PERMANENT 
    

    A default route is a route used to direct data that is addressed to an unidentifiable network address. To define a default route, use the /DEFAULT qualifier.

  5. The following command sets a default route. NIGHTINGALE is the default gateway.


    TCPIP> SET ROUTE /DEFAULT /GATEWAY=NIGHTINGALE 
    

    To check that your routes are set up correctly, use either the LOOP or PING command.

4.2.3 Displaying Manually Defined Routes

To display static routes, use the SHOW ROUTE command. To see the permanent database, specify the /PERMANENT qualifier.

The display shows the following types of routes:

To display a route that was defined by an address, specify either its address or a wildcard.

Some examples of displaying routes are listed below.

  1. The following example displays information about all the manually defined routes.


    TCPIP> SHOW ROUTE /FULL 
                                 DYNAMIC 
    Type           Destination               Gateway 
     
    AN   11.111.0.0   destin_host1   11.110.5.118   gate_host 
    AH   22.111.4.10  destin_host2   22.110.5.120   gate_host_2 
     
    

  2. The following example displays the permanent static routes that were defined with SET ROUTE/PERMANENT.


    TCPIP> SHOW ROUTE /PERMANENT 
     
                                 PERMANENT 
     
    Type           Destination               Gateway 
     
    PN    0.0.0.0                     11.20.208.100   pterodactyl.extinct.com 
    PN    1.1.1.1                     22.2.2.2 
     
    

Another way to display route information is by using the netstat UNIX command. For example, to display the routes, and suppress conversion of network numbers to names, enter the following commands:


$ @SYS$MANAGER:TCPIP$DEFINE_COMMANDS.COM 
 
$ netstat -rn 
Routing tables 
Destination      Gateway            Flags     Refs     Use  Interface 
 
Route Tree for Protocol Family 26: 
 
Route Tree for Protocol Family 2: 
default          16.20.0.173        UG          0        0  WE1 
default          16.20.0.173        UG          0        0  WE0 
16.20/16         16.20.208.161      U           2       56  WE1 
16.20/16         16.20.208.160      U           1        9  WE0 
16.20.208.160    16.20.208.160      UHL         0        0  WE0 
16.20.208.161    16.20.208.161      UHL         0        0  WE1 
127.0.0.1        127.0.0.1          UHL         1        1  LO0 

This example shows a multihomed host with two interface adapters. For more information about the netstat utility, enter the following command:


TCPIP> HELP NETSTAT 

4.3 Enabling and Disabling Dynamic Routing

Use the configuration procedure TCPIP$CONFIG to enable dynamic routing and configure your host to receive routing protocol messages as follows:

  1. Select the Routing option from the Core Environment menu.
  2. Answer "Yes" to the question "Do you want to configure dynamic ROUTED or GATED routing [NO]:"
  3. You are asked whether you want to enable GATED.


    Do you want to enable GATED routing configuration? 
    

    If you answer "Yes" to this question, GATED will be enabled. If you answer "No," ROUTED will be enabled.

  4. If you choose to enable ROUTED, indicate whether you want your host to supply RIP updates to other hosts on the network (in addition to receiving RIP updates) and the default network route.
  5. If you choose to enable GATED, you must also configure the routing protocols in the GATED configuration file TCPIP$GATED.CONF. See Section 4.4 for more information about configuring GATED.

To disable dynamic routing:

  1. Select the "Routing" option from the CORE ENVIRONMENT menu.
  2. Answer "Yes" to the following questions:


    Do you want to reconfigure dynamic ROUTED or GATED routing [NO]: Y 
     
    Do you want to disable dynamic ROUTED or GATED routing configuration 
    [NO]: Y 
    

    Alternatively, enter the TCP/IP management command STOP ROUTING.

When you disable GATED routing, the GATED routes are preserved. To disable GATED and remove all GATED routes from the routing table, enter the command STOP ROUTING/GATED.

4.4 Configuring GATED

You must configure the GATED protocols before starting GATED routing. Edit a copy of the sample file TCPIP$GATED.TEMPLATE (located in the SYS$SYSDEVICE:[TCPIP$GATED] directory) to add statements that select routing protocols, manage routing information, manage independent system routing, and control tracing options.

  1. Use TCPIP$CONFIG to enable GATED.
  2. Edit the TCPIP$GATED.TEMPLATE file.
  3. Save the file TCPIP$GATED.CONF in the SYS$SYSDEVICE:[TCPIP$GATED] directory.
  4. If GATED is already running, stop it by entering the command STOP ROUTING/GATED.
  5. Start GATED by entering the command START ROUTING/GATED.
    See the Compaq TCP/IP Services for OpenVMS Management Command Reference manual for detailed descriptions of the SET GATED and START ROUTING/GATED commands.

If you do not format the configuration file correctly, GATED terminates.

For specific information about how to edit the GATED configuration file, see Appendix A.

4.4.1 Datagram Reassembly Time

Reassembly is the process of reconstructing a complete data message from received fragments. The reassembly timer determines the length of time allowed for the reassembly process. You can modify the reassembly timer to ensure that IP datagram fragments are optimally reassembled at the destination host.

Consider the following when setting the reassembly timer:

Enter the following commands to reset the reassembly timer:

In the following example, the first command changes the IP reassembly time to 20 seconds on the running system. This new setting remains in effect until the next TCP/IP Services startup.

The second command makes the change permanent by modifying the configuration database, TCPIP$CONFIGURATION.DAT.


TCPIP> SET PROTOCOL IP /REASSEMBLY_TIMER=20 
 
TCPIP> SET CONFIGURATION PROTOCOL IP /REASSEMBLY_TIMER=20 

4.4.2 Enabling Forwarding

To enable packet forwarding between networks, enter the following TCP/IP management command:


TCPIP> SET PROTOCOL IP /FORWARD 

To ensure this is set up the next time TCP/IP Services is restarted, enter the following command:


TCPIP> SET CONFIGURATION PROTOCOL IP /FORWARD 

Display the setting using the following command:


TCPIP> SHOW PROTOCOL /PARAMETERS 

Or use the sysconfig utility to enable forwarding. First, define foreign commands:


$ @SYS$MANAGER:TCPIP$DEFINE_COMMANDS.COM 

Enter the following sysconfig command:


$ sysconfig -r inet ipforwarding=1 ipgateway=1 

To make sure forwarding is enabled after restarting TCP/IP Services, add the command to TCPIP$SYSTARTUP.COM.

To view the setting, use the following command:


$ sysconfig -q inet ipforwarding ipgateway 

When multiple networks share the same physical media and the host has just one interface, it is still possible to forward packets between these networks by creating a network alias, as described in Section 2.3.3.

For example, consider a network in which two networks have network addresses of 16.20.1/24 and 16.20.2/24, and the host address is 180. If the host has a single ethernet interface, WE0, create the interface and pseudointerfaces as follows:


TCPIP> SET CONFIGURATION INTERFACE WE0 /HOST=16.20.1.180 - 
_TCPIP> /NETWORK_MASK=255.255.255.0 /BROADCAST_MASK=16.20.1.255 
 
TCPIP> SET CONFIGURATION INTERFACE WEA0 /HOST=16.20.2.180 - 
_TCPIP> /NETWORK_MASK=255.255.255.0 /BROADCAST_MASK=16.20.2.255 
 
TCPIP> SET CONFIGURATION PROTOCOL IP /FORWARD 

When TCP/IP Services is restarted, the host will forward packets between these networks.

Alternatively, you can add the following commands to TCPIP$SYSTARTUP.COM and then restart TCP/IP Services:


$ ifconfig we0 aliaslist 16.20.1-2.180/24 
 
$ sysconfig -r inet ipforwarding=1 ipgateway=1 


Previous Next Contents Index