History log of /openbsd-current/sbin/route/route.8
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.119 02-Aug-2023 aisha

add EXIT STATUS section with information for the exec subcommand

patch by Matthew Martin <phy1729 AT gmail DOT com>


# 1.118 06-Apr-2023 kn

Markup route flags to get tags

":tM" to jump to the definition of RTF_MODIFIED is easier and faster than
manually navigating there.

OK schwarze


Revision tags: OPENBSD_7_3_BASE
# 1.117 18-Mar-2023 jmc

sourceaddr:

- show that -ifp and "address" do not mix
- show how to reset value (from claudio)
- tweak text

ok claudio


# 1.116 15-Mar-2023 jmc

tweak sourceaddr:

- remove "-inet|-inet6" as it is not generally meaningful
- remove the qualifier "if set": sourceaddr now works nicely in cases
where no "address is given


# 1.115 07-Mar-2023 kn

restore tags for commands lost in r1.112 restructuring; OK jmc


# 1.114 07-Mar-2023 jmc

mpls gateway clarification; from claudio


# 1.113 03-Mar-2023 jsg

namservers -> nameservers


# 1.112 02-Mar-2023 jmc

restructure the page into one single list for all routing commands;
while there, whack anything either out of date or not useful

joint work with claudio


# 1.111 21-Feb-2023 jmc

some nameserver proposal bits:

unwind.8: point to resolvd(8) for autoconf sources
unwind.conf.5: order preferred list by order of preference
resolvd.8: reformat to read better
route.8: no need to discuss unwind in the nameserver command
umb.4 + sppp.4: note the sending of nameserver proposals

the umb/sppp text is from claudio
tobhe confirmed iked sending proposals when configured to do so

much assistance and ok: florian claudio


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.118 06-Apr-2023 kn

Markup route flags to get tags

":tM" to jump to the definition of RTF_MODIFIED is easier and faster than
manually navigating there.

OK schwarze


Revision tags: OPENBSD_7_3_BASE
# 1.117 18-Mar-2023 jmc

sourceaddr:

- show that -ifp and "address" do not mix
- show how to reset value (from claudio)
- tweak text

ok claudio


# 1.116 15-Mar-2023 jmc

tweak sourceaddr:

- remove "-inet|-inet6" as it is not generally meaningful
- remove the qualifier "if set": sourceaddr now works nicely in cases
where no "address is given


# 1.115 07-Mar-2023 kn

restore tags for commands lost in r1.112 restructuring; OK jmc


# 1.114 07-Mar-2023 jmc

mpls gateway clarification; from claudio


# 1.113 03-Mar-2023 jsg

namservers -> nameservers


# 1.112 02-Mar-2023 jmc

restructure the page into one single list for all routing commands;
while there, whack anything either out of date or not useful

joint work with claudio


# 1.111 21-Feb-2023 jmc

some nameserver proposal bits:

unwind.8: point to resolvd(8) for autoconf sources
unwind.conf.5: order preferred list by order of preference
resolvd.8: reformat to read better
route.8: no need to discuss unwind in the nameserver command
umb.4 + sppp.4: note the sending of nameserver proposals

the umb/sppp text is from claudio
tobhe confirmed iked sending proposals when configured to do so

much assistance and ok: florian claudio


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.116 15-Mar-2023 jmc

tweak sourceaddr:

- remove "-inet|-inet6" as it is not generally meaningful
- remove the qualifier "if set": sourceaddr now works nicely in cases
where no "address is given


# 1.115 07-Mar-2023 kn

restore tags for commands lost in r1.112 restructuring; OK jmc


# 1.114 07-Mar-2023 jmc

mpls gateway clarification; from claudio


# 1.113 03-Mar-2023 jsg

namservers -> nameservers


# 1.112 02-Mar-2023 jmc

restructure the page into one single list for all routing commands;
while there, whack anything either out of date or not useful

joint work with claudio


# 1.111 21-Feb-2023 jmc

some nameserver proposal bits:

unwind.8: point to resolvd(8) for autoconf sources
unwind.conf.5: order preferred list by order of preference
resolvd.8: reformat to read better
route.8: no need to discuss unwind in the nameserver command
umb.4 + sppp.4: note the sending of nameserver proposals

the umb/sppp text is from claudio
tobhe confirmed iked sending proposals when configured to do so

much assistance and ok: florian claudio


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.115 07-Mar-2023 kn

restore tags for commands lost in r1.112 restructuring; OK jmc


# 1.114 07-Mar-2023 jmc

mpls gateway clarification; from claudio


# 1.113 03-Mar-2023 jsg

namservers -> nameservers


# 1.112 02-Mar-2023 jmc

restructure the page into one single list for all routing commands;
while there, whack anything either out of date or not useful

joint work with claudio


# 1.111 21-Feb-2023 jmc

some nameserver proposal bits:

unwind.8: point to resolvd(8) for autoconf sources
unwind.conf.5: order preferred list by order of preference
resolvd.8: reformat to read better
route.8: no need to discuss unwind in the nameserver command
umb.4 + sppp.4: note the sending of nameserver proposals

the umb/sppp text is from claudio
tobhe confirmed iked sending proposals when configured to do so

much assistance and ok: florian claudio


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.113 03-Mar-2023 jsg

namservers -> nameservers


# 1.112 02-Mar-2023 jmc

restructure the page into one single list for all routing commands;
while there, whack anything either out of date or not useful

joint work with claudio


# 1.111 21-Feb-2023 jmc

some nameserver proposal bits:

unwind.8: point to resolvd(8) for autoconf sources
unwind.conf.5: order preferred list by order of preference
resolvd.8: reformat to read better
route.8: no need to discuss unwind in the nameserver command
umb.4 + sppp.4: note the sending of nameserver proposals

the umb/sppp text is from claudio
tobhe confirmed iked sending proposals when configured to do so

much assistance and ok: florian claudio


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.111 21-Feb-2023 jmc

some nameserver proposal bits:

unwind.8: point to resolvd(8) for autoconf sources
unwind.conf.5: order preferred list by order of preference
resolvd.8: reformat to read better
route.8: no need to discuss unwind in the nameserver command
umb.4 + sppp.4: note the sending of nameserver proposals

the umb/sppp text is from claudio
tobhe confirmed iked sending proposals when configured to do so

much assistance and ok: florian claudio


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.110 14-Feb-2023 kn

Typofix -ssthresh in HISTORY


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.109 22-Dec-2022 kn

Denote multiple arguments with 'arg ...' not 'args'

A few programs used the plural in their synopsis which doesn't read as
clear as the obvious triple-dot notation.

mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent
use of 'arg ...' matches that behaviour.

Cleanup a few markups of the same argument so the text keeps reading
naturally; omit unhelpful parts like 'if optional arguments are given,
they are passed along' for tools like time(1) and timeout(1) that obviously
execute commands with whatever arguments where given -- just like doas(1)
which doesn't mention arguments in its DESCRIPTION in the first place.

For expr(1) the difference between 'expressions' and 'expression ...' is
crucial, as arguments must be passed as individual words.

Feedback millert jmc schwarze deraadt
OK jmc


# 1.108 22-Dec-2022 jmc

it seems we made a separate list for the two sourceaddr commands,
just to remove some vertical spacing; that is unfortunate
because when i adjusted the list spacing it did not affect this second
list, and logically it is one list (route commands) not two;

resolve this by having one -compact list, and inserting Pp between list items
where needed;


# 1.107 22-Dec-2022 jmc

move the flag mappings displayed by "route show" from netstat(1) to route(8):
diff from paul tagliamonte, who was surprised to find them not documented
in route(8);

claudio agreed placement was not ideal;
deraadt confirmed users better served by route(8) than netstat(1);

i've tweaked some of the spacing and text so it displays better,
and removed some macros incorrectly associated with the "nameserver"
list item, which was messing up the formatting. should display better
now


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.106 19-Nov-2022 kn

fix vertical spacing in previous


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.105 09-Nov-2022 sthen

add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler


Revision tags: OPENBSD_7_2_BASE
# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.104 29-Jul-2022 kn

Mention id(1) -R, reference rtable(4) in route(8)

Fix "ps -o rtable" example description while here.

Initial idea to mention id -R in route(8) from sthen
Feedback OK sthen


Revision tags: OPENBSD_7_1_BASE
# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.103 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.102 26-Oct-2021 kn

Generalise "nameserver" workings

The generated route message is not at all resolvd(8) specific.
Mention how unwind(8) reacts to proposals as well.

"Broadcast" wording deraadt jmc
OK millert


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.101 22-Oct-2021 kn

Make ":tdelete" work

r1.91 added tags for all commands, but "del[ete]" is special in that
mandoc(1) will generate a tag for "del" only.

Add an explicit for the full command to fix this.


Revision tags: OPENBSD_7_0_BASE
# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.100 30-Aug-2021 kn

Clarify how dns proposals are replaced not added per interface

OK benno


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.99 29-Aug-2021 kn

nameserver command requires an interface argument


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.98 05-Aug-2021 jmc

for nameserver usage, show multiple addresses as "address ..."; ok benno
while here, Pa->Xr for resolv.conf;


# 1.97 05-Aug-2021 jmc

sort the new nameserver text; rework it a little; sort SEE ALSO;


# 1.96 04-Aug-2021 benno

Add a new 'nameserver' command to route(8).
It sends nameserver proposals to resolvd(8) using the dns proposal
protocol over the route socket. Based on a seperate program
written by florian@. deraadt noticed some whitespace issues.
more fixes and ok florian@


Revision tags: OPENBSD_6_9_BASE
# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.95 02-Jan-2021 schwarze

add three missing .Dv macros,
and move punctuation out of two that are already there


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.94 07-Nov-2020 denis

Rework source IP address setting.

- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@)
- Remove memory allocation, store pointer to existing ifaddr
- Fix tunnel interface handling

looks fine mpi@


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.93 30-Oct-2020 denis

Source address set can be printed


# 1.92 29-Oct-2020 denis

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.91 19-Jan-2020 schwarze

add some explicit tagging macros; OK kn@ on a previous version


Revision tags: OPENBSD_6_6_BASE
# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.90 30-Apr-2019 jmc

elaborate a little on how route priorities work;
help/ok claudio


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.89 17-Apr-2019 jmc

signpost the location of the text explaining routing table output a little better...


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.88 14-Jul-2018 benno

Document that route monitor also takes -T rtable as an argument.


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.87 13-Jul-2018 kn

Use "rtable" not "tableid" as argument name for rtable

Make rtable(4) usage documentation consistent with other programs.
This is to have `man -k ar~rtable' show the full list without having to
look for other variations of the same argument type.

OK bluhm


# 1.86 09-Jul-2018 jca

Kill fluff about how route(8) is of limited usefulness

Don't say that route(8) is mostly useful to set up a default route,
which is almost a lie. What's more, I'm not sure new users struggling
with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as
a solution to their problems. ok benno@ kn@


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.85 30-Apr-2018 schwarze

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@


# 1.84 28-Apr-2018 schwarze

remove references to /etc/networks; reminded by jmc@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_2_BASE
# 1.83 06-Sep-2017 benno

backout previous diff:
autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@
it breaks with ipv6 link-local routes, e.g.
/sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0
found by jmc@
ok florian


# 1.82 11-Aug-2017 jmc

new sentence, new line;


# 1.81 10-Aug-2017 benno

document use of del as short form for delete, from jca
ok schwarze@


# 1.80 10-Aug-2017 benno

autodetect AF when setting inet6 default route
From Denis Fondras, thanks!
ok phessler@ bluhm@


Revision tags: OPENBSD_6_1_BASE
# 1.79 01-Jan-2017 tb

Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'
if they precede the noun and omit hyphens otherwise.

ok tj


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.78 11-Sep-2015 mpi

Remove RTF_XRESOLVE support.


Revision tags: OPENBSD_5_8_BASE
# 1.77 18-Jul-2015 phessler

On systems with a full routing table (550k+), we often want to be able to
look at the routes with a priority, or to display all routes that do not
have a specific priority (normally, don't show bgp).

We are intentionally not updating netstat -r yet, as we do not have a
good flag to use.

first version from, and OK benno@


# 1.76 17-May-2015 deraadt

nope, ioctl has not been used for a while


# 1.75 06-May-2015 mpi

Document that priority 1 is reserved for kernel use.


Revision tags: OPENBSD_5_7_BASE
# 1.74 06-Feb-2015 reyk

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.73 26-Feb-2014 claudio

Try to be more precise about rtable and rdomains.


# 1.72 22-Jan-2014 claudio

Remove genmask support from route(8). It still will show them in monitor
or get but you can no longer set it. genmask will die soon since nobody
needs it. OK benno@ and agreed by dlg@


Revision tags: OPENBSD_5_4_BASE
# 1.71 27-May-2013 sthen

autodetect ipv6 addresses for route(8). ok benno@ bluhm@, manpage help jmc@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.70 13-Jul-2012 benno

allow destination/prefixlen syntax for ipv6 routes.
from Florian Obser, florian -AT- narrans -DOT- de

ok sthen@


Revision tags: OPENBSD_5_1_BASE
# 1.69 03-Sep-2011 jmc

make -column lists pretty again;

specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.

in some cases i have rewritten the lists as -tag, where -column made
little sense.


Revision tags: OPENBSD_5_0_BASE
# 1.68 05-Jul-2011 jmc

kill a useless Pp;


# 1.67 05-Jul-2011 claudio

Flip one .Fl interface to .Fl iface since iface is used everywhere else
even though -interface is the same as -iface.
OK jmc@


Revision tags: OPENBSD_4_9_BASE
# 1.66 21-Sep-2010 jmc

15 months later, there is still no mpls(4) man page: .Xr mpls 4 -> MPLS


# 1.65 21-Sep-2010 krw

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.64 20-Dec-2009 deraadt

First shot at making this manual page not look like a black sheep. Been
looking at it with claudio since I started doing more routing stuff.


# 1.63 11-Dec-2009 jmc

be a little more specific about -ifp; from Doran Mori


# 1.62 01-Dec-2009 reyk

Add the new exec command to run a process and its children in a
non-default rdomain/rtable. route will change the default rdomain
using the new setrdomain() syscall and execute the supplied command,
eg. "route -T1 exec /usr/sbin/named".

Tested by many including michele@, phessler@
ok claudio@, deraadt@


# 1.61 04-Nov-2009 jmc

tweak previous;


# 1.60 03-Nov-2009 claudio

Lies. We no longer support this magic netmask at the end of the line
compatibility.


Revision tags: OPENBSD_4_6_BASE
# 1.59 25-Jun-2009 michele

Document how to add static MPLS labels.

input jmc@, ok claudio@


# 1.58 30-May-2009 claudio

Make it possible to filter monitor output on AF or show only interface
specific changes. OK henning@


# 1.57 30-May-2009 claudio

Make route flush more powerful by allowing -iface/-interface or -priority
to be specified. So only routes matching these conditions will be flushed.
This will help making dhclient less dumb when fiddeling with routes.
OK henning@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.56 07-May-2008 claudio

Document -priority. looks good norby@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.55 04-Jun-2007 henning

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to


# 1.54 31-May-2007 jmc

convert to new .Dd format;


# 1.53 25-Mar-2007 claudio

Instead of using the global -F flag that only works with show, switch to a
show specific modifier -gateway to show only routes whose gateway are in the
same AF as the destination.
Requested by deraadt@, OK pyr@, reyk@, michele@


# 1.52 23-Mar-2007 jmc

add -F to SYNOPSIS;


# 1.51 23-Mar-2007 pyr

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@


Revision tags: OPENBSD_4_1_BASE
# 1.50 19-Jan-2007 jmc

add an EXAMPLES section;

from mark lumsden via otto, tidied up somewhat by myself;
ok otto claudio


# 1.49 15-Jan-2007 stevesk

reference ripd(8) vs. routed(8) and remove routed statement in BUGS
that no longer applies because it is not referenced. ok claudio@ jmc@


# 1.48 29-Nov-2006 jmc

tweak; ok henning


# 1.47 28-Nov-2006 jmc

add -T to synopsis;


# 1.46 28-Nov-2006 henning

-T in synopsis and briefly in manpage


# 1.45 16-Oct-2006 mcbride

More details on multipath.

ok henning + style suggestions from jmc


Revision tags: OPENBSD_4_0_BASE
# 1.44 30-Mar-2006 hshoexer

document -encap. ok claudio@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.43 30-Mar-2005 henning

mention ospfd as well


# 1.42 30-Mar-2005 henning

remove ccitt x.25 traces, ok theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.41 10-Aug-2004 jaredy

update to reality
- fix syntax usage
- remove source routing stuff
- mention bgpd
- document -t, -genmask (from FreeBSD), and -label
- move -rtt, -rttvar, -recvpipe ... into HISTORY
- remove ISO mention
mdoc fixes
sort list of and add syntax usage for sub-commands
list supported address families in a separate table
consistency and reorganizational fixes
elaborate on some topics (some from NetBSD)
punctuation, grammar, and rewording fixes
add some FILES and cross-refs

requested by, help, and ok henning
help and ok jmc


# 1.40 03-Aug-2004 henning

-src/-srcmask are no more


# 1.39 15-Jul-2004 jmc

remove references to removed pages: clnp(4), esis(4), and iso(4);


# 1.38 28-Jun-2004 jmc

- repair examples which i damaged in previous commit
- tidy up DIAGNOSTICS, and use -diag
- wording

from jared yanovich;


# 1.37 26-Jun-2004 jmc

grammar, formatting, consistency, spelling, etc. from jared yanovich;


# 1.36 26-Jun-2004 jmc

grammar;


# 1.35 25-Jun-2004 henning

remove netiso and netns code


# 1.34 19-Jun-2004 cedric

require RTF_MPATH to enter a multipath route with RTM_ADD.
route(8) takes a new -mpath modifier to enter a multipath route.
requested deraadt@, ok itojun@ mcbride@ millert@


# 1.33 18-Jun-2004 millert

Make this better reflect reality; OK and with help from Cedric


# 1.32 06-Jun-2004 jmc

- wording
- simplify some displays


# 1.31 06-Jun-2004 cedric

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

route add -src 20.20.20.22 20.20.20.21
route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.30 31-Aug-2003 jmc

add references to /etc/mygate in FILES and SEE ALSO;
from Han Boetes.


# 1.29 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.28 11-Feb-2003 jmc

typos;

raidctl(8) ok millert@
mknetid(8) help maja@


Revision tags: OPENBSD_3_2_BASE
# 1.27 08-Jun-2002 itojun

support IPv4 in -prefixlen.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE
# 1.26 20-Dec-2000 deraadt

document "default" argument


Revision tags: OPENBSD_2_8_BASE
# 1.25 27-Jul-2000 angelos

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.


Revision tags: OPENBSD_2_7_BASE
# 1.24 15-Apr-2000 aaron

- For consistency, `super-user' -> `superuser' in all cases.
- Some punctuation fixes.
- Some `id' -> `ID'.


# 1.23 15-Apr-2000 aaron

Mostly punctuation fixes.


# 1.22 12-Apr-2000 aaron

Trailing whitespace begone!


# 1.21 18-Mar-2000 aaron

Remove hard sentence breaks, and some other cleanup along the way.


# 1.20 14-Mar-2000 aaron

Suffix "i.e." and "e.g." with a comma. Just another really picky man page
commit, as we want our documentation to be as consistently formatted as
possible (it's getting there :-)).


# 1.19 08-Dec-1999 itojun

ipv6 support from KAME (needs no libc upgrade). regen keywords.[ch].


Revision tags: OPENBSD_2_6_BASE
# 1.18 29-Jul-1999 ho

Modified 'route flush' default behaviour to skip '-encap' (PF_KEY) flows,
as deleting these will leave the SPIs behind. 'route flush -encap' will
still delete the flows. 'ipsecadm' should do this, and properly.

PF_KEY/AF_KEY nitpick. Sync man page. Add ref to ipsecadm(1).


# 1.17 04-Jun-1999 aaron

start to remove non-escaped trailing whitespace, it can confuse troff; pjanzen@


# 1.16 23-May-1999 aaron

remove argument from .Os macros so value in /usr/share/tmac/mdoc/doc-common
is used instead; kwesterback@home.com


# 1.15 12-May-1999 aaron

grammar police: do not hyphenate compound words that act as adjectives if the
first word ends in -ly

i.e., fully-qualified, newly-created, globally-visible, etc. are wrong


Revision tags: OPENBSD_2_5_BASE
# 1.14 16-Mar-1999 deraadt

fix Xr; msfriedl@fau.de


# 1.13 15-Dec-1998 deraadt

clean; form


# 1.12 15-Dec-1998 aaron

always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net


# 1.11 28-Nov-1998 aaron

kill redundant .Nm macro arguments; other misc fixes


# 1.10 11-Nov-1998 aaron

more `` '' -> .Dq sillyness; remove redundant .Pp macros; other misc fixes


Revision tags: OPENBSD_2_4_BASE
# 1.9 23-Sep-1998 aaron

alphabetize SEE ALSO entries and order them numerically according to section


# 1.8 17-Sep-1998 aaron

sbin/ man page fixes


Revision tags: OPENBSD_2_3_BASE
# 1.7 15-Jan-1998 niklas

document -d


Revision tags: OPENBSD_2_2_BASE
# 1.6 13-Jul-1997 angelos

Added -encap flag for flushing, added a missing break; in flushing X25
entries.


Revision tags: OPENBSD_2_1_BASE
# 1.5 10-Apr-1997 deraadt

allow syntax of the form "route add -net 192.168.64.0/20 <destaddr>";
phk@freebsd, man page changes done by me 'cause i'm a bit bored


# 1.4 14-Dec-1996 deraadt

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall


Revision tags: OPENBSD_2_0_BASE
# 1.3 16-Aug-1996 mickey

ipx.


# 1.2 23-Jun-1996 deraadt

update rcsid


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision