Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add an "rtsol" keyword to ifconfig.if for enabling IPv6 RS/RA
details: https://anonhg.NetBSD.org/src/rev/ff6302f8cd4f
branches: trunk
changeset: 1009191:ff6302f8cd4f
user: kim <kim%NetBSD.org@localhost>
date: Wed Apr 15 20:31:57 2020 +0000
description:
Add an "rtsol" keyword to ifconfig.if for enabling IPv6 RS/RA
diffstat:
etc/rc.d/network | 12 ++++++++++--
share/man/man5/ifconfig.if.5 | 32 +++++++++++++++++++++++++++++++-
usr.sbin/rtsold/rtsold.8 | 21 +++++++++++++++++----
3 files changed, 58 insertions(+), 7 deletions(-)
diffs (124 lines):
diff -r 70a623789058 -r ff6302f8cd4f etc/rc.d/network
--- a/etc/rc.d/network Wed Apr 15 19:26:51 2020 +0000
+++ b/etc/rc.d/network Wed Apr 15 20:31:57 2020 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: network,v 1.77 2020/02/22 11:52:45 roy Exp $
+# $NetBSD: network,v 1.78 2020/04/15 20:31:57 kim Exp $
#
# PROVIDE: network
@@ -215,7 +215,8 @@
# For each line from the $ifconfig_xxN variable or the
# /etc/ifconfig.xxN file, we ignore comments and blank lines,
# treat lines beginning with "!" as commands to execute, treat
- # "dhcp" as a special case to invoke dhcpcd, and for any other
+ # "dhcp" as a special case to invoke dhcpcd, treat "rtsol" as
+ # a special case to send a router solicitation, and for any other
# line we run "ifconfig xxN", using each line of the file as the
# arguments for a separate "ifconfig" invocation.
#
@@ -322,6 +323,13 @@
${dhcpcd_flags} $int
fi
;;
+ rtsol)
+ if ! checkyesno dhcpcd; then
+ /sbin/sysctl -qw \
+ net.inet6.ip6.accept_rtadv=1
+ /sbin/dhcpcd -q6T --nodhcp6 $int
+ fi
+ ;;
*)
# Pass args to ifconfig. Note
# that args may contain embedded
diff -r 70a623789058 -r ff6302f8cd4f share/man/man5/ifconfig.if.5
--- a/share/man/man5/ifconfig.if.5 Wed Apr 15 19:26:51 2020 +0000
+++ b/share/man/man5/ifconfig.if.5 Wed Apr 15 20:31:57 2020 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ifconfig.if.5,v 1.18 2014/12/29 14:22:25 wiz Exp $
+.\" $NetBSD: ifconfig.if.5,v 1.19 2020/04/15 20:31:57 kim Exp $
.\"
.\" Copyright (c) 1996 Matthew R. Green
.\" All rights reserved.
@@ -94,6 +94,23 @@
and any per interface configuration or restriction is done in
.Xr dhcpcd.conf 5 .
.Pp
+If the line is equal to
+.Dq rtsol ,
+kernel processing of router advertisements will be enabled and an IPv6
+router solicitation message will be sent out on the interface.
+This is useful on networks where default routes can best be learned
+from router advertisements.
+However, if
+.Sy dhcpcd
+has been set to true in
+.Xr rc.conf 5 ,
+it is assumed that
+.Xr dhcpcd 8
+will take care of sending any necessary router solicitation messages and
+processing received router advertisements through its configuration in
+.Xr dhcpcd.conf 5
+instead.
+.Pp
If a line is empty, or starts with
.Sq # ,
the line will be ignored as comment.
@@ -119,6 +136,19 @@
inet6 2001:db8:: prefixlen 64 alias anycast
.Ed
.Pp
+For networks that do not use a virtual address for the default gateway
+that could be set using a single address in
+.Sy defaultroute6 ,
+static IPv6 address configuration could use the
+.Dq rtsol
+keyword instead to solicit router advertisements for learning a default
+route and even achieving route redundancy given multiple responding
+routers:
+.Bd -literal -offset indent
+inet6 2001:db8::100 prefixlen 64 alias
+rtsol
+.Ed
+.Pp
The following example sets a network name for a wireless interface
(using quotes to protect special characters in the name),
and starts
diff -r 70a623789058 -r ff6302f8cd4f usr.sbin/rtsold/rtsold.8
--- a/usr.sbin/rtsold/rtsold.8 Wed Apr 15 19:26:51 2020 +0000
+++ b/usr.sbin/rtsold/rtsold.8 Wed Apr 15 20:31:57 2020 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: rtsold.8,v 1.39 2020/04/13 20:44:39 wiz Exp $
+.\" $NetBSD: rtsold.8,v 1.40 2020/04/15 20:31:58 kim Exp $
.\" $KAME: rtsold.8,v 1.17 2001/07/09 22:30:37 itojun Exp $
.\"
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -46,10 +46,23 @@
as their functionality is now included in
.Xr dhcpcd 8 .
.Pp
-For example to send a routing solicitation message and print information
-about it without changing the actual routing table:
+For example to send a router solicitation message and print information
+about the response without changing the actual routing table:
.Pp
.Dl dhcpcd -dB6T --nodhcp6 < Ns Ar interface Ns \^>
+.Pp
+To quietly send a router solicitation message:
+.Pp
+.Dl dhcpcd -q6T --nodhcp6 < Ns Ar interface Ns \^>
+.Pp
+The
+.Xr ifconfig.if 5
+network interface configuration files and variables can also use an
+.Dq rtsol
+keyword to invoke
+.Xr dhcpcd 8
+to send a router solicitation message, without running it as daemon.
.\"
.Sh SEE ALSO
-.Xr dhcpcd 8
+.Xr dhcpcd 8 ,
+.Xr ifconfig.if 5
Home |
Main Index |
Thread Index |
Old Index