1 ROUTEADM(1M)                 Maintenance Commands                 ROUTEADM(1M)
   2 
   3 NAME
   4      routeadm - IP forwarding and routing configuration
   5 
   6 SYNOPSIS
   7      routeadm [-p [option]]
   8      routeadm [-R root-dir] [-e option ...] [-d option ...] [-r option ...]
   9               [-s var=value]
  10      routeadm -l fmri
  11      routeadm -m fmri key=value [key=value]...
  12      routeadm -u
  13 
  14 DESCRIPTION
  15      The routeadm command is used to administer system-wide configuration for
  16      IP forwarding and routing.  IP forwarding is the passing of IP packets
  17      from one network to another; IP routing is the use of a routing protocol
  18      to determine routes.
  19 
  20      IP forwarding and routing functions are also represented as services
  21      within the service management facility (SMF), and can be administered by
  22      means of svcadm(1M) also, using the following fault management resource
  23      identifiers (FMRIs):
  24 
  25      svc:/network/ipv4-forwarding:default
  26      svc:/network/ipv6-forwarding:default
  27      svc:/network/routing/route:default
  28      svc:/network/routing/ripng:default
  29 
  30      See EXAMPLES for relevant examples.
  31 
  32      In addition to enabling and disabling routing and forwarding, routeadm is
  33      used to interact with SMF-based routing daemon services.  Routing daemon
  34      services are identified by the presence of a routeadm application
  35      property group, which routeadm uses in administering the given service.
  36      Routing daemon services can also specify properties relating to their
  37      operation in the routing application property group; these can be
  38      modified by means of routeadm -m.  If an FMRI for a service without such
  39      a property group is specified, an error is issued and the operation is
  40      not carried out.  If a routing daemon has not been converted to SMF, the
  41      ipv4-routing-daemon, ipv6-routing-daemon, ipv4-routing-daemon-args,
  42      ipv6-routing-daemon-args, and ipv4-routing-stop-cmd,
  43      ipv6-routing-stop-cmd variables can be used to specify the appropriate
  44      daemon for IPv4 or IPv6 routing.  routeadm will then run that daemon
  45      using the svc:/network/routing/legacy-routing:ipv4 or
  46      svc:/network/routing/legacy-routing:ipv6 service as appropriate.  This
  47      conversion process occurs when you issue an enable (-e), disable (-d) or
  48      an update (-u) command.
  49 
  50      The first usage, in the SYNOPSIS above, reports the current
  51      configuration.
  52 
  53 OPTIONS
  54      The following command-line options are supported:
  55 
  56      -d option ...
  57              Disable the specified option.  The effect is to prepare the
  58              associated services (svc:/network/ipv4-forwarding:default in the
  59              case of ipv4-forwarding) for disabling.  By means of the
  60              routing-svcs variable, the routing daemons are specified to be
  61              disabled on subsequent boot or when routeadm -u is run.
  62 
  63      -e option ...
  64              Enable the specified option.  The effect is to prepare the
  65              associated services (svc:/network/ipv4-forwarding:default in the
  66              case of ipv4-forwarding) for enabling.  By means of the
  67              routing-svcs variable, the routing daemons are specified to be
  68              enabled on subsequent boot or when routeadm -u is run.
  69 
  70      -l fmri
  71              List all properties in the routing application property group for
  72              the SMF routing daemon service.
  73 
  74      -m fmri key=value
  75              Change property value of property key to value in routing
  76              application property group for the SMF routing daemon service.
  77              For multi-valued properties, the property name can be used
  78              multiple times in the modify operation, and each associated value
  79              will be added.
  80 
  81      -p [option]
  82              Print the configuration in parsable format.  If option is
  83              specified, only the configuration for the specified option or
  84              variable is displayed.
  85 
  86      -r option ...
  87              Revert the specified option to the system default.  The system
  88              defaults are specified in the description of each option.
  89 
  90      -R root-dir
  91              Specify an alternate root directory where routeadm applies
  92              changes.
  93 
  94              Note: The root file system of any non-global zones must not be
  95              referenced with the -R option.  Doing so might damage the global
  96              zone's file system, might compromise the security of the global
  97              zone, and might damage the non-global zone's file system.  See
  98              zones(5).
  99 
 100      -s key=value
 101              Specify string values for specific variables in a comma-separated
 102              list with no intervening spaces.  If invalid options are
 103              specified, a warning message is displayed and the program exits.
 104              The following variables can be specified:
 105 
 106              routing-svcs=fmrilist
 107                      Specifies the routing daemon services to be enabled.
 108                      Routing daemon services are determined to be IPv4 or IPv6
 109                      (and so enabled or disabled when routeadm -e/-d
 110                      ipv4(6)-routing is run) on the basis of property values
 111                      in the routeadm application property group.  Default:
 112                      empty.
 113 
 114              ipv4-routing-daemon=full_path_to_routing_daemon
 115                      Specifies the routing daemon to be started when
 116                      ipv4-routing is enabled.  The routing daemon specified
 117                      must be an executable binary or shell-script.  If the
 118                      specified program maps to an SMF service, the service
 119                      will be used, and daemon arguments to the program will be
 120                      transferred to the properties of the service at enable
 121                      time.  Default: empty string.
 122 
 123              ipv4-routing-daemon-args=args
 124                      Specifies the startup arguments to be passed to the
 125                      ipv4-routing-daemon when ipv4-routing is enabled.
 126                      Default: no arguments
 127 
 128              ipv4-routing-stop-cmd=command
 129                      Specifies the command to be executed to stop the routing
 130                      daemon when ipv4-routing is disabled.  command can be an
 131                      executable binary or shell-script, or a string that can
 132                      be parsed by system(3C).  Default: empty string.
 133 
 134              ipv6-routing-daemon=full_path_to_routing_daemon
 135                      Specifies the routing daemon to be started when
 136                      ipv6-routing is enabled.  The routing daemon specified
 137                      must be an executable binary or shell-script.  If the
 138                      specified program maps to an SMF service, the service
 139                      will be used, and daemon arguments to the program will be
 140                      transferred to the properties of the service at enable
 141                      time.  Default: empty string.
 142 
 143              ipv6-routing-daemon-args=args
 144                      Specifies the startup arguments to be passed to the
 145                      ipv6-routing-daemon when ipv6-routing is enabled.
 146                      Default: empty string.
 147 
 148              ipv6-routing-stop-cmd=command
 149                      Specifies the command to be executed to stop the routing
 150                      daemon when ipv6-routing is disabled.  command can be an
 151                      executable binary or shell-script, or a string that can
 152                      be parsed by system(3C).  Default: empty string.
 153 
 154      -u      Apply the currently configured options to the running system.
 155              These options might include enabling or disabling IP forwarding
 156              and launching or killing routing daemons, if any are specified.
 157              It does not alter the state of the system for those settings that
 158              have been set to default.  This option is meant to be used by
 159              administrators who do not want to reboot to apply their changes.
 160              In addition, this option upgrades non-SMF configurations from the
 161              invocations of daemon stop commands, which might include a set of
 162              arguments, to a simple enabling of the appropriate service.
 163 
 164      Multiple -e, -d, and -r options can be specified on the command line.
 165      Changes made by -e, -d, and -r are persistent, but are not applied to the
 166      running system unless routeadm is called later with the -u option.
 167 
 168      Use the following options as arguments to the -e, -d, and -r options
 169      (shown above as option ...):
 170 
 171      ipv4-forwarding
 172              Controls the global forwarding configuration for all IPv4
 173              interfaces.  The system default is disabled.  If enabled, IP will
 174              forward IPv4 packets to and from interfaces when appropriate.  If
 175              disabled, IP will not forward IPv4 packets to and from interfaces
 176              when appropriate.  The SMF service associated with this
 177              configuration variable is svc:/network/routing/ipv4-forwarding.
 178              This service will be enabled or disabled as appropriate when
 179              routeadm is called with the -u option.  As an alternative, you
 180              can use svcadm(1M).  Services that require ipv4-forwarding to be
 181              enabled should specify a dependency on this service.
 182 
 183      ipv4-routing
 184              Determines whether an IPv4 routing daemon is run.  The system
 185              default is disabled.  The value of this option reflects the state
 186              of all IPv4 routing services, such that if any IPv4 routing
 187              service is enabled, ipv4-routing is enabled.  This allows users
 188              to interact with routing services using svcadm(1M), as well as
 189              through routeadm.  IPv4 routing services, specified by means of
 190              the routing-svcs variable, will be prepared for enable on next
 191              boot when the user explicitly enables ipv4-routing.
 192 
 193      ipv6-forwarding
 194              Controls the global forwarding configuration for all IPv6
 195              interfaces.  The system default is disabled.  If enabled, IP will
 196              forward IPv6 packets to and from interfaces when appropriate.  If
 197              disabled, IP will not forward IPv6 packets to and from interfaces
 198              when appropriate.  The SMF service associated with this
 199              configuration variable is svc:/network/routing/ipv6-forwarding.
 200              This service will be enabled or disabled as appropriate when
 201              routeadm is called with the -u option, or svcadm(1M) is used.
 202              Services that require ipv6-forwarding to be enabled should
 203              specify a dependency on this service.
 204 
 205      ipv6-routing
 206              Determines whether an IPv6 routing daemon is run.  The system
 207              default is disabled.  The value of this option reflects the state
 208              of all IPv6 routing services, such that, if any IPv6 routing
 209              service is enabled, ipv6-routing is enabled.  This allows users
 210              to interact with routing services via svcadm(1M) as well as
 211              through routeadm.  IPv6 routing services, specified by means of
 212              the routing-svcs variable, will be prepared for enable on next
 213              boot when the user explicitly enables ipv6-routing.
 214 
 215      The forwarding and routing settings are related but not mutually
 216      dependent.  For example, a router typically forwards IP packets and uses
 217      a routing protocol, but nothing would prevent an administrator from
 218      configuring a router that forwards packets and does not use a routing
 219      protocol.  In that case, the administrator would enable forwarding,
 220      disable routing, and populate the router's routing table with static
 221      routes.
 222 
 223      The forwarding settings are global settings.  Each interface also has an
 224      IFF_ROUTER forwarding flag that determines whether packets can be
 225      forwarded to or from a particular interface.  That flag can be
 226      independently controlled by means of ifconfig(1M) router option.  When
 227      the global forwarding setting is changed (that is, -u is issued to change
 228      the value from enabled to disabled or vice-versa), all interface flags in
 229      the system are changed simultaneously to reflect the new global policy.
 230      Interfaces configured by means of DHCP automatically have their
 231      interface-specific IFF_ROUTER flag cleared.
 232 
 233      When a new interface is plumbed by means of ifconfig, the value of the
 234      interface-specific forwarding flag is set according to the current global
 235      forwarding value.  Thus, the forwarding value forms the "default" for all
 236      new interfaces.
 237 
 238 FILES
 239      /etc/inet/routing.conf            Parameters for IP forwarding and
 240                                        routing.  (Not to be edited.)
 241 
 242 EXIT STATUS
 243      The routeadm utility exits 0 on success, and >0 if      an error occurs.
 244 
 245 EXAMPLES
 246      Example 1 Enabling IPv4 Forwarding
 247              IPv4 forwarding is disabled by default.  The following command
 248              enables IPv4 forwarding:
 249 
 250              # routeadm -e ipv4-forwarding
 251 
 252      Example 2 Apply Configured Settings to the Running System
 253              In the previous example, a system setting was changed, but will
 254              not take effect until the next reboot unless a command such as
 255              the following is used:
 256 
 257              # routeadm -u
 258 
 259              An alternative to the above two steps is to simply enable the
 260              equivalent SMF service:
 261 
 262              # svcadm enable svc:/network/ipv4-forwarding
 263 
 264              ...or, using the abbreviated FMRI:
 265 
 266              # svcadm enable ipv4-forwarding
 267 
 268      Example 3 Making a Setting Revert to its Default
 269              To make the setting changed in the first example revert to its
 270              default, enter the following:
 271 
 272              # routeadm -r ipv4-forwarding
 273              # routeadm -u
 274 
 275      Example 4 Starting in.routed with the -q Flag
 276              Setting the -q flag is represented in the SMF service by setting
 277              the quiet_mode property to true.  The following sequence of
 278              commands starts in.routed with the -q flag:
 279 
 280              # routeadm -m route:default quiet_mode=true
 281              # routeadm -e ipv4-routing -u
 282 
 283              See in.routed(1M) for details of property names and how they
 284              relate to daemon behavior.
 285 
 286 INTERFACE STABILITY
 287      Stable.
 288 
 289 SEE ALSO
 290      ifconfig(1M), in.routed(1M), svcadm(1M), gateways(4), attributes(5),
 291      smf(5)
 292 
 293 illumos                          July 4, 2018                          illumos