1routeadm(1M)            System Administration Commands            routeadm(1M)
2
3
4

NAME

6       routeadm - IP forwarding and routing configuration
7

SYNOPSIS

9       routeadm  [-p  [option]]
10
11
12       routeadm  [-R root-dir] [-e option ...] [-d option...]
13        [-r option...] [-s var=value]
14
15
16       routeadm  [-l fmri]
17
18
19       routeadm  [-m fmri key=value [key=value]...]
20
21
22       routeadm  [-u]
23
24

DESCRIPTION

26       The  routeadm  command  is used to administer system-wide configuration
27       for IP forwarding and routing. IP forwarding is the passing of IP pack‐
28       ets  from  one  network  to another; IP routing is the use of a routing
29       protocol to determine routes.
30
31
32       IP forwarding and routing functions are also  represented  as  services
33       within  the  service management facility (SMF), and can be administered
34       by means of svcadm(1M)  also,  using  the  following  fault  management
35       resource identifiers (FMRIs):
36
37         svc:/network/ipv4-forwarding:default
38         svc:/network/ipv6-forwarding:default
39         svc:/network/routing/route:default
40         svc:/network/routing/ripng:default
41
42
43
44       See EXAMPLES for relevant examples.
45
46
47       In  addition to enabling and disabling routing and forwarding, routeadm
48       is used to interact with SMF-based  routing  daemon  services.  Routing
49       daemon  services  are identified by the presence of a routeadm applica‐
50       tion property group, which routeadm uses  in  administering  the  given
51       service.  Routing  daemon services can also specify properties relating
52       to their operation in the routing application property group; these can
53       be  modified  by means of routeadm -m. If an FMRI for a service without
54       such a property group is specified, an error is issued and  the  opera‐
55       tion  is not carried out. If a routing daemon has not been converted to
56       SMF, the ipv4[or 6]-routing-daemon, ipv4[or 6]-routing-daemon-args, and
57       ipv4[or 6]-routing-stop-cmd variables can be used to specify the appro‐
58       priate daemon for IPv4 or IPv6 routing. routeadm  will  then  run  that
59       daemon using the svc:/network/routing/legacy-routing:ipv4[or 6] service
60       as appropriate. This conversion process occurs when you issue an enable
61       (-e), disable (-d) or an update (-u) command.
62
63
64       The  first usage, in the SYNOPSIS above, reports the current configura‐
65       tion.
66

OPTIONS

68       The following command-line options are supported:
69
70       -p [option]
71
72           Print the configuration in parseable format. If  option  is  speci‐
73           fied,  only  the configuration for the specified option or variable
74           is displayed.
75
76
77       -R root-dir
78
79           Specify an alternate root directory where routeadm applies changes.
80           This  can  be  useful from within JumpStart scripts, where the root
81           directory of the system being modified is mounted elsewhere.
82
83           Note -
84
85             The root file system of any non-global zones must not  be  refer‐
86             enced with the -R option. Doing so might damage the global zone's
87             file system, might compromise the security of  the  global  zone,
88             and might damage the non-global zone's file system. See zones(5).
89
90
91       -e option...
92
93           Enable  the  specified option. The effect is to prepare the associ‐
94           ated services (svc:/network/ipv4-forwarding:default in the case  of
95           ipv4-forwarding)  for  enabling. By means of the routing-svcs vari‐
96           able, the routing daemons are specified to be enabled on subsequent
97           boot or when routeadm -u is run.
98
99
100       -d option...
101
102           Disable  the specified option. The effect is to prepare the associ‐
103           ated services (svc:/network/ipv4-forwarding:default in the case  of
104           ipv4-forwarding)  for  enabling. By means of the routing-svcs vari‐
105           able, the routing daemons are specified to be  disabled  on  subse‐
106           quent boot or when routeadm -u is run.
107
108
109       -l fmri
110
111           List  all  properties in the routing application property group for
112           the SMF routing daemon service.
113
114
115       -m fmri key=value
116
117           Change property value of property key to value in routing  applica‐
118           tion  property group for the SMF routing daemon service. For multi-
119           valued properties, the  property name can be used multiple times in
120           the modify operation, and each associated value will be added.
121
122
123       -r option...
124
125           Revert  the  specified  option  to  the  system default. The system
126           defaults are specified in the description of each option.
127
128
129       -u
130
131           Apply the currently configured options to the running system. These
132           options  might  include  enabling  or  disabling  IP forwarding and
133           launching or killing routing daemons, if any are specified. It does
134           not alter the state of the system for those settings that have been
135           set to default. This option is meant to be used  by  administrators
136           who do not want to reboot to apply their changes. In addition, this
137           option upgrades non-SMF configurations from the invocations of dae‐
138           mon  stop  commands,  which  might include a set of arguments, to a
139           simple enabling of the appropriate service.
140
141
142       -s key=value
143
144           Specify string values for specific variables in  a  comma-separated
145           list  with no intervening spaces. If invalid options are specified,
146           a warning message is displayed and the program exits. The following
147           variables can be specified:
148
149           routing-svcs=fmrilist
150
151               Specifies  the  routing  daemon services to be enabled. Routing
152               daemon services are determined to  be  IPv4  or  IPv6  (and  so
153               enabled or disabled when routeadm -e/-d ipv4(6)-routing is run)
154               on the basis of property values  in  the  routeadm  application
155               property group. Default: route:default ripng:default
156
157
158           ipv4-routing-daemon=<full_path_to_routing_daemon>
159
160               Specifies the routing daemon to be started when ipv4-routing is
161               enabled. The routing daemon specified  must  be  an  executable
162               binary or shell-script. If the specified program maps to an SMF
163               service, the service will be used, and daemon arguments to  the
164               program will be transferred to the properties of the service at
165               enable time. Default: ""
166
167
168           ipv4-routing-daemon-args=<args>
169
170               Specifies the startup arguments to be passed to the  ipv4-rout‐
171               ing-daemon when ipv4-routing is enabled. Default: no arguments
172
173
174           ipv4-routing-stop-cmd=<command>
175
176               Specifies the command to be executed to stop the routing daemon
177               when ipv4-routing is disabled. <command> can be  an  executable
178               binary  or shell-script, or a string that can be parsed by sys‐
179               tem(3C). Default: ""
180
181
182           ipv6-routing-daemon=<full_path_to_routing_daemon>
183
184               Specifies the routing daemon to be started when ipv6-routing is
185               enabled.  The  routing  daemon  specified must be an executable
186               binary or shell-script. If the specified program maps to an SMF
187               service,  the service will be used, and daemon arguments to the
188               program will be transferred to the properties of the service at
189               enable time. Default: ""
190
191
192           ipv6-routing-daemon-args=<args>
193
194               Specifies  the startup arguments to be passed to the ipv6-rout‐
195               ing-daemon when ipv6-routing is enabled. Default: ""
196
197
198           ipv6-routing-stop-cmd=<command>
199
200               Specifies the command to be executed to stop the routing daemon
201               when  ipv6-routing  is disabled. <command> can be an executable
202               binary or shell-script, or a string that can be parsed by  sys‐
203               tem(3C). Default: ""
204
205
206
207
208       Multiple  -e,  -d, and -r options can be specified on the command line.
209       Changes made by -e, -d, and -r are persistent, but are not  applied  to
210       the running system unless routeadm is called later with the -u option.
211
212
213       Use  the  following  options as arguments to the -e, -d, and -r options
214       (shown above as option...).
215
216       ipv4-forwarding
217
218           Controls the global forwarding configuration for  all  IPv4  inter‐
219           faces.  The system default is disabled. If enabled, IP will forward
220           IPv4 packets to and from interfaces when appropriate. If  disabled,
221           IP will not forward IPv4 packets to and from interfaces when appro‐
222           priate. The SMF service associated with this configuration variable
223           is   svc:/network/routing/ipv4-forwarding.  This  service  will  be
224           enabled or disabled as appropriate when routeadm is called with the
225           u  option. As an alternative, you can use svcadm(1M). Services that
226           require ipv4-forwarding to be enabled should specify  a  dependency
227           on this service.
228
229
230       ipv4-routing
231
232           Determines  whether  an  IPv4  routing  daemon  is  run. The system
233           default is enabled unless the /etc/defaultrouter file  exists  (see
234           defaultrouter(4)), in which case the default is disabled. The value
235           of this option reflects the state of  all  IPv4  routing  services,
236           such  that  if any IPv4 routing service is enabled, ipv4-routing is
237           enabled. This allows users to interact with routing services  using
238           svcadm(1M),  as  well  as  through routeadm. IPv4 routing services,
239           specified by means of the routing-svcs variable, will  be  prepared
240           for enable on next boot when the user explicitly enables ipv4-rout‐
241           ing. The  SMF  routing  daemon  service  for  in.routed  (svc:/net‐
242           work/routing/route:default) is specified by default.
243
244
245       ipv6-forwarding
246
247           Controls  the  global  forwarding configuration for all IPv6 inter‐
248           faces. The system default is disabled. If enabled, IP will  forward
249           IPv6  packets to and from interfaces when appropriate. If disabled,
250           IP will not forward IPv6 packets to and from interfaces when appro‐
251           priate. The SMF service associated with this configuration variable
252           is  svc:/network/routing/ipv6-forwarding.  This  service  will   be
253           enabled or disabled as appropriate when routeadm is called with the
254           -u option, or svcadm(1M) is used. Services that  require  ipv6-for‐
255           warding to be enabled should specify a dependency on this service.
256
257
258       ipv6-routing
259
260           Determines  whether  an  IPv6  routing  daemon  is  run. The system
261           default is disabled. The value of this option reflects the state of
262           all  IPv6  routing services, such that, if any IPv6 routing service
263           is enabled, ipv6-routing is enabled. This allows users to  interact
264           with  routing  services via svcadm(1M) as well as through routeadm.
265           IPv6 routing services, specified by means of the routing-svcs vari‐
266           able,  will  be  prepared  for  enable  on  next boot when the user
267           explicitly enables ipv6-routing. The SMF routing daemon service for
268           in.ripngd   (svc:/network/routing/ripng:default)  is  specified  by
269           default.
270
271
272
273       The forwarding and routing settings are related but not mutually depen‐
274       dent.  For  example,  a router typically forwards IP packets and uses a
275       routing protocol, but nothing would prevent an administrator from  con‐
276       figuring a router that forwards packets and does not use a routing pro‐
277       tocol. In that case, the administrator would enable forwarding, disable
278       routing, and populate the router's routing table with static routes.
279
280
281       The forwarding settings are global settings. Each interface also has an
282       IFF_ROUTER forwarding flag that determines whether packets can be  for‐
283       warded  to  or  from  a particular interface. That flag can be indepen‐
284       dently controlled by means of ifconfig(1M)'s router  option.  When  the
285       global  forwarding  setting is changed (that is, -u is issued to change
286       the value from enabled to disabled or vice-versa), all interface  flags
287       in the system are changed simultaneously to reflect the new global pol‐
288       icy. Interfaces configured by means of DHCP  automatically  have  their
289       interface-specific IFF_ROUTER flag cleared.
290
291
292       When  a new interface is plumbed by means of ifconfig, the value of the
293       interface-specific forwarding flag is  set  according  to  the  current
294       global forwarding value. Thus, the forwarding value forms the "default"
295       for all new interfaces.
296

EXAMPLES

298       Example 1 Enabling IPv4 Forwarding
299
300
301       IPv4 forwarding is disabled by default. The following  command  enables
302       IPv4 forwarding:
303
304
305         example# routeadm -e ipv4-forwarding
306
307
308
309       Example 2 Apply Configured Settings to the Running System
310
311
312       In  the  previous  example,  a system setting was changed, but will not
313       take effect until the next reboot unless a command such as the  follow‐
314       ing is used:
315
316
317         example# routeadm -u
318
319
320
321
322       An  alternative  to the above two steps is to simply enable the equiva‐
323       lent SMF service:
324
325
326         example# svcadm enable svc:/network/ipv4-forwarding
327
328
329
330
331       ...or, using the abbreviated FMRI:
332
333
334         example# svcadm enable ipv4-forwarding
335
336
337
338       Example 3 Making a Setting Revert to its Default
339
340
341       To make the setting changed in the first example revert to its default,
342       enter the following:
343
344
345         example# routeadm -r ipv4-forwarding
346         example# routeadm -u
347
348
349
350       Example 4 Starting in.routed with the -q Flag
351
352
353       Setting  the  -q  flag is represented in the SMF service by setting the
354       quiet_mode property to true. The following sequence of commands  starts
355       in.routed with the -q flag:
356
357
358         example# routeadm -m route:default quiet_mode=true
359         example# routeadm -e ipv4-routing -u
360
361
362
363
364       See  in.routed(1M) for details of property names and how they relate to
365       daemon behavior.
366
367

EXIT STATUS

369       The following exit values are returned:
370
371       0      Successful completion.
372
373
374       !=0    An error occurred while obtaining or modifying the  system  con‐
375              figuration.
376
377

FILES

379       /etc/inet/routing.conf    Parameters  for  IP  forwarding  and routing.
380                                 (Not to be edited.)
381
382

ATTRIBUTES

384       See attributes(5) for descriptions of the following attributes:
385
386
387
388
389       ┌─────────────────────────────┬─────────────────────────────┐
390       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
391       ├─────────────────────────────┼─────────────────────────────┤
392       │Availability                 │SUNWcsu                      │
393       ├─────────────────────────────┼─────────────────────────────┤
394       │Interface Stability          │Stable                       │
395       └─────────────────────────────┴─────────────────────────────┘
396

SEE ALSO

398       ifconfig(1M), in.routed(1M),  svcadm(1M),  gateways(4),  attributes(5),
399       smf(5)
400
401
402
403SunOS 5.11                        18 Jul 2007                     routeadm(1M)
Impressum