summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ifstated
diff options
context:
space:
mode:
authormpf <mpf@openbsd.org>2018-01-20 22:57:11 +0000
committermpf <mpf@openbsd.org>2018-01-20 22:57:11 +0000
commit0d2274c8df37e0e796e7d40fd653e2e63bb0c4ca (patch)
tree31f36a1611d7498ffdbe5590e535c446c65087c7 /usr.sbin/ifstated
parentDisable TCP and UDP transmit checksum offloading (diff)
downloadwireguard-openbsd-0d2274c8df37e0e796e7d40fd653e2e63bb0c4ca.tar.xz
wireguard-openbsd-0d2274c8df37e0e796e7d40fd653e2e63bb0c4ca.zip
Improve the config example.
Suggest using carpdemote instead of tweaking the advskew setting. Also add a check for a non-carp link state. Prodded by jmc@. OK jmc@, rob@.
Diffstat (limited to 'usr.sbin/ifstated')
-rw-r--r--usr.sbin/ifstated/ifstated.conf.521
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/ifstated/ifstated.conf.5 b/usr.sbin/ifstated/ifstated.conf.5
index 2721871926c..5f1cc8321c6 100644
--- a/usr.sbin/ifstated/ifstated.conf.5
+++ b/usr.sbin/ifstated/ifstated.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifstated.conf.5,v 1.9 2012/04/24 14:56:09 jmc Exp $
+.\" $OpenBSD: ifstated.conf.5,v 1.10 2018/01/20 22:57:11 mpf Exp $
.\"
.\" Copyright (c) 2005 Nikolay Sturm <sturm@openbsd.org>
.\" Copyright (c) 2005 Marco Pfatschbacher <mpf@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 24 2012 $
+.Dd $Mdocdate: January 20 2018 $
.Dt IFSTATED.CONF 5
.Os
.Sh NAME
@@ -94,7 +94,7 @@ keyword.
.Pp
For example:
.Bd -literal -offset indent
-carp_up = "carp0.link.up && carp1.link.up"
+links_up = "em0.link.up && em1.link.up"
net = '( "ping -q -c 1 -w 1 192.168.0.1 > /dev/null" every 10 && \e
"ping -q -c 1 -w 1 192.168.0.2 > /dev/null" every 10 )'
.Ed
@@ -138,17 +138,18 @@ For example:
.Bd -literal -offset indent
state one {
init {
- run "ifconfig carp0 advskew 10"
- run "ifconfig carp1 advskew 10"
+ run "logger -t ifstated entering state one"
+ run "ifconfig -g carp -carpdemote"
}
- if ! $net
+ if ! $net || urndis0.link.up
set-state two
- if ! $carp_up {
- run "ifconfig carp0 advskew 254"
- run "ifconfig carp1 advskew 254"
- set-state three
+ if ! $links_up {
+ run "ifconfig -g carp carpdemote"
+
+ if urndis0.link.down
+ set-state three
}
}
.Ed