System Administration Guide: IP Services

ProcedureHow to Enable Dynamic Routing on a Single-Interface Host

Dynamic routing is the easiest way to manage routing on a host. Hosts that use dynamic routing run the routing protocols provided by the in.routed daemon for IPv4 or in.ripngd daemon for IPv6. Use the next procedure to enable IPv4 dynamic routing on a single interface host. For more information about dynamic routing, refer to Packet Forwarding and Routing on IPv4 Networks.

  1. On the host, assume the Primary Administrator role or become superuser.

    The Primary Administrator role includes the Primary Administrator profile. To create the role and assign the role to a user, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Verify whether the /etc/defaultrouter file exists.


    # cd /etc
    # ls | grep defaultrouter
    
  3. If /etc/defaultrouter exists, delete any entry that you find there.

    An empty /etc/defaultrouter file forces the host to use dynamic routing.

  4. Verify whether packet forwarding and routing are enabled on the host.


    # routeadm
       Configuration   Current              Current
                         Option   Configuration        System State
    ---------------------------------------------------------------
                   IPv4 routing   disabled             disabled
                   IPv6 routing   disabled             disabled
                IPv4 forwarding   enabled              enabled
                IPv6 forwarding   disabled             disabled
    
               Routing services   "route:default ripng:default"
  5. If packet forwarding is enabled, turn it off

    Use either of the following commands:

    • For the routeadm command, type the following:


      # routeadm -d ipv4-forwarding -u
      
    • To use SMF, type the following:


      # svcadm disable ipv4-forwarding
      
  6. Enable routing protocols on the host.

    Use either of the following commands:

    • For the routeadm command, type the following:


      # routeadm -e ipv4-routing -u
      
    • To use SMF, type the following:


      # svcadm enable route:default
      

    Now IPv4 dynamic routing is enabled. The host's routing table is dynamically maintained by the in.routed daemon.


Example 5–8 Running Dynamic Routing on a Single-Interface Host

The following example shows how to configure dynamic routing for hosta, a single-interface host on the network 192.168.5.0 that is shown in Figure 5–3. hosta currently uses Router 1 as its default router. However, hosta now needs to run dynamic routing.

First, you would log in to hosta as superuser or assume an equivalent role. Then, you would determine whether the /etc/defaultrouter file is present on the host:


# cd /etc
# ls | grep defaultrouter
defaultrouter

The response from grep indicates that a /etc/defaultrouter file exists for hosta.


# vi /etc/defaultrouter
192.168.5.10

The file has the entry 192.168.5.10, which is the IP address for Router 1. You would delete this entry to enable static routing. Next, you would need to verify whether packet forwarding and routing are already enabled for the host.


# routeadm   Configuration   Current              Current
                     Option   Configuration        System State
---------------------------------------------------------------
               IPv4 routing   disabled             disabled
               IPv6 routing   disabled             disabled
            IPv4 forwarding   disabled             disabled
            IPv6 forwarding   disabled             disabled

           Routing services   "route:default ripng:default"

Both routing and packet forwarding are turned off for hosta. Turn on routing to complete the configuration of dynamic routing for hosta, as follows:


# svcadm enable route:default