System Administration Commands routeadm(1M) NAME routeadm - IP forwarding and routing configuration SYNOPSIS routeadm [-p] routeadm [-R root-dir] [-e option...] [-d option...] [-r option...] routeadm [-u] DESCRIPTION The routeadm command is used to administer system-wide con- figuration for IP forwarding and routing. IP forwarding is the passing of IP packets from one network to another; IP routing is the use of a routing protocol to determine routes. routeadm is used to enable or disable each function indepen- dently, overriding any system default setting for each func- tion. | The first usage, above, reports the current configuration. OPTIONS The following command-line options are supported: -p Print the configuration in parseable format. -R root-dir Specify an alternate root directory where routeadm applies changes. This can be useful from within JumpStart scripts, where the root directory of the system being modified is mounted elsewhere. -e option... Enable the specified option. -d option... Disable the specified option. -r option... Revert the specified option to the system default, which means that the configuration is left to the sys- tem boot scripts' existing default logic. -u Apply the currently configured options to the running system. Enable or disable IP forwarding, and/or launch or kill routing daemons. It does not alter the state of the system for those settings that have been set to default. This option is meant to be used by SunOS 5.10 Last change: 15 Jul 2003 1 System Administration Commands routeadm(1M) administrators who do not want to reboot to apply their changes. Multiple -e, -d, and -r options can be specified on the com- mand line. Changes made by -e, -d, and -r are persistent, but are not applied to the running system unless routeadm is called later with the -u option. Use the following options as arguments to the -e, -d, and -r options (shown above as option...). ipv4-forwarding Controls the global forwarding configuration for all IPv4 interfaces. The system default is disabled. If | enabled, IP will forward IPv4 | packets to and from interfaces when appropriate. If disabled, IP will not forward IPv4 packets to and from interfaces when appropriate. | ipv4-routing Determines whether or not an IPv4 routing daemon is run. The system default is enabled unless the | /etc/defaultrouter file exists, in which case the | default is disabled. The routing daemon for IPv4 is | /usr/sbin/in.routed. | ipv6-forwarding Controls the global forwarding configuration for all IPv6 interfaces. The system default is disabled. If | enabled, IP will forward IPv6 | packets to and from interfaces when appropriate. If disabled, IP will not forward IPv6 packets to and from interfaces when appropriate. | ipv6-routing Determines whether or not an IPv6 routing daemon is run. The system default is disabled. The routing | daemon for IPv6 is /usr/lib/inet/in.ripngd. | Note that even if this option is | enabled, an IPv6 routing daemon will run only if | ipv6-forwarding is also enabled. | The forwarding and routing settings are related but not mutually dependent. For example, a router will typically forward IP packets and use a routing protocol, but nothing would prevent an administrator from configuring a router that forwards packets and does not use a routing protocol. In that case, the administrator would enable forwarding, SunOS 5.10 Last change: 15 Jul 2003 2 System Administration Commands routeadm(1M) disable routing, and populate the router's routing table with static routes. The forwarding settings are global settings. Each interface also has an IFF_ROUTER forwarding flag that determines whether packets can be forwarded to or from a particular interface. That flag can be independently controlled by means of ifconfig(1M)'s router option. When the global for- warding setting is changed (that is, -u is issued to change the value from enabled to disabled or vice-versa), all interface flags in the system are changed simultaneously to reflect the new global policy. Interfaces configured by means of DHCP automatically have their interface-specific IFF_ROUTER flag cleared. When a new interface is plumbed by means of ifconfig(1M), the value of the interface-specific forwarding flag is set according to the current global forwarding value. Thus, the forwarding value forms the "default" for all new interfaces. | EXIT STATUS The following exit values are returned: 0 Successful completion. !=0 An error occurred while obtaining or modifying the system configuration. EXAMPLES Example 1: Disabling IPv4 Forwarding on a Multihomed System By default, IPv4 forwarding is enabled on a system that has more than one IPv4 interface configured. The following com- mand disables IPv4 forwarding on such a system: example# routeadm -d ipv4-forwarding Example 2: Apply Configured Settings to the Running System In the previous example, a system setting was changed, but will not take effect until the next reboot unless a command such as the followingis used: example# routeadm -u Example 3: Making a Setting Revert to the Boot-Time Default If you want to make the setting changed in the first example revert to the boot-time default, enter the following: example# routeadm -r ipv4-forwarding example# routeadm -u ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: SunOS 5.10 Last change: 15 Jul 2003 4 System Administration Commands routeadm(1M) ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | Interface Stability | Stable | |_____________________________|_____________________________| SEE ALSO ifconfig(1M), in.routed(1M), gateways(4), attributes(5) SunOS 5.10 Last change: 15 Jul 2003 5