xref: /openbsd-src/share/man/man5/mygate.5 (revision 6e5266148af681e7d74ed5f347690fe8ea5f0ae4)
1.\"	$OpenBSD: mygate.5,v 1.2 2021/10/17 13:20:46 kn Exp $
2.\"
3.\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: October 17 2021 $
18.Dt MYGATE 5
19.Os
20.Sh NAME
21.Nm mygate
22.Nd default gateway
23.Sh DESCRIPTION
24The
25.Nm mygate
26file is read by
27.Xr netstart 8
28at system startup time.
29.Pp
30.Pa /etc/mygate ,
31if it exists,
32contains the address of the gateway host.
33The gateway is added to the routing tables by the
34.Xr route 8
35utility.
36If
37.Pa /etc/mygate
38does not exist, no default gateway is added to the routing tables.
39The file may contain gateway addresses for both IPv4 and IPv6 networks
40in dotted quad notation for v4
41.Pq e.g. 192.0.2.1
42or in colon notation for v6
43.Pq e.g. 2001:db8::1 .
44Each address must be specified on a separate line.
45If more than one address of a specific family is found,
46only the first is used \- all other addresses of that family are ignored.
47.Pp
48.Pa /etc/mygate
49is processed after all interfaces have been configured.
50If any
51.Xr hostname.if 5
52files contain
53.Dq inet autoconf
54directives,
55IPv4 entries in
56.Pa /etc/mygate
57will be ignored.
58If they contain
59.Dq inet6 autoconf
60directives,
61IPv6 entries will be ignored.
62.Pp
63Additionally, arbitrary shell commands can be executed during processing
64of this file, using
65.Ar \&! Ns Ar command
66directives similar to
67.Xr hostname.if 5 .
68This is useful for doing additional configuration after all interfaces
69are configured by
70.Xr netstart 8 .
71.Pp
72Empty lines and lines beginning with
73.Sq #
74are ignored.
75.Sh FILES
76.Bl -tag -width "/etc/mygate" -compact
77.It Pa /etc/mygate
78Default gateway address(es).
79.El
80.Sh SEE ALSO
81.Xr hostname.if 5 ,
82.Xr netstart 8 ,
83.Xr route 8
84.Sh HISTORY
85This manual page first appeared in
86.Ox 3.4 .
87