1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00
freebsd/sys/netinet6
Hiroki Sato e7fa8d0ada - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1.
- A new per-interface knob IFF_ND6_NO_RADR and sysctl IPV6CTL_NO_RADR.
  This controls if accepting a route in an RA message as the default route.
  The default value for each interface can be set by net.inet6.ip6.no_radr.
  The system wide default value is 0.

- A new sysctl: net.inet6.ip6.norbit_raif.  This controls if setting R-bit in
  NA on RA accepting interfaces.  The default is 0 (R-bit is set based on
  net.inet6.ip6.forwarding).

Background:

 IPv6 host/router model suggests a router sends an RA and a host accepts it for
 router discovery.  Because of that, KAME implementation does not allow
 accepting RAs when net.inet6.ip6.forwarding=1.  Accepting RAs on a router can
 make the routing table confused since it can change the default router
 unintentionally.

 However, in practice there are cases where we cannot distinguish a host from
 a router clearly.  For example, a customer edge router often works as a host
 against the ISP, and as a router against the LAN at the same time.  Another
 example is a complex network configurations like an L2TP tunnel for IPv6
 connection to Internet over an Ethernet link with another native IPv6 subnet.
 In this case, the physical interface for the native IPv6 subnet works as a
 host, and the pseudo-interface for L2TP works as the default IP forwarding
 route.

Problem:

 Disabling processing RA messages when net.inet6.ip6.forwarding=1 and
 accepting them when net.inet6.ip6.forward=0 cause the following practical
 issues:

 - A router cannot perform SLAAC.  It becomes a problem if a box has
   multiple interfaces and you want to use SLAAC on some of them, for
   example.  A customer edge router for IPv6 Internet access service
   using an IPv6-over-IPv6 tunnel sometimes needs SLAAC on the
   physical interface for administration purpose; updating firmware
   and so on (link-local addresses can be used there, but GUAs by
   SLAAC are often used for scalability).

 - When a host has multiple IPv6 interfaces and it receives multiple RAs on
   them, controlling the default route is difficult.  Router preferences
   defined in RFC 4191 works only when the routers on the links are
   under your control.

Details of Implementation Changes:

 Router Advertisement messages will be accepted even when
 net.inet6.ip6.forwarding=1.  More precisely, the conditions are as
 follow:

 (ACCEPT_RTADV && !NO_RADR && !ip6.forwarding)
	=> Normal RA processing on that interface. (as IPv6 host)

 (ACCEPT_RTADV && (NO_RADR || ip6.forwarding))
	=> Accept RA but add the router to the defroute list with
	   rtlifetime=0 unconditionally.  This effectively prevents
	   from setting the received router address as the box's
	   default route.

 (!ACCEPT_RTADV)
	=> No RA processing on that interface.

 ACCEPT_RTADV and NO_RADR are per-interface knob.  In short, all interface
 are classified as "RA-accepting" or not.  An RA-accepting interface always
 processes RA messages regardless of ip6.forwarding.  The difference caused by
 NO_RADR or ip6.forwarding is whether the RA source address is considered as
 the default router or not.

 R-bit in NA on the RA accepting interfaces is set based on
 net.inet6.ip6.forwarding.  While RFC 6204 W-1 rule (for CPE case) suggests
 a router should disable the R-bit completely even when the box has
 net.inet6.ip6.forwarding=1, I believe there is no technical reason with
 doing so.  This behavior can be set by a new sysctl net.inet6.ip6.norbit_raif
 (the default is 0).

Usage:

 # ifconfig fxp0 inet6 accept_rtadv
	=> accept RA on fxp0
 # ifconfig fxp0 inet6 accept_rtadv no_radr
	=> accept RA on fxp0 but ignore default route information in it.
 # sysctl net.inet6.ip6.norbit_no_radr=1
	=> R-bit in NAs on RA accepting interfaces will always be set to 0.
2011-06-06 02:14:23 +00:00
..
dest6.c
frag6.c
icmp6.c
icmp6.h
in6_cksum.c
in6_gif.c
in6_gif.h
in6_ifattach.c
in6_ifattach.h
in6_mcast.c
in6_pcb.c Add _mbuf() variants of various inpcb-related interfaces, including lookup, 2011-06-04 16:33:06 +00:00
in6_pcb.h Add _mbuf() variants of various inpcb-related interfaces, including lookup, 2011-06-04 16:33:06 +00:00
in6_proto.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
in6_rmx.c
in6_src.c Decompose the current single inpcbinfo lock into two locks: 2011-05-30 09:43:55 +00:00
in6_var.h
in6.c The statically configured (permanent) ARP entries are removed when an 2011-05-20 19:12:20 +00:00
in6.h - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
ip6_ecn.h
ip6_forward.c
ip6_id.c
ip6_input.c
ip6_ipsec.c Make IPsec compile without INET adding appropriate #ifdef checks. 2011-04-27 19:28:42 +00:00
ip6_ipsec.h
ip6_mroute.c
ip6_mroute.h
ip6_output.c
ip6_var.h - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
ip6.h
ip6protosw.h
mld6_var.h
mld6.c
mld6.h
nd6_nbr.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
nd6_rtr.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
nd6.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
nd6.h - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
pim6_var.h
pim6.h
raw_ip6.c
raw_ip6.h
route6.c
scope6_var.h
scope6.c
sctp6_usrreq.c Remove code with any effect. 2011-05-03 20:34:02 +00:00
sctp6_var.h
send.c
send.h Use uint8_t for sockaddr sa_len. 2011-06-05 11:40:30 +00:00
tcp6_var.h
udp6_usrreq.c Add _mbuf() variants of various inpcb-related interfaces, including lookup, 2011-06-04 16:33:06 +00:00
udp6_var.h