Bug 156689

Summary: stf(4) output-only documentation gives bad configuration advice
Product: Documentation Reporter: marka
Component: Manual PagesAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: doc, electrotounes08
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description marka 2011-04-28 08:00:21 UTC
The stf documentation suggests the following configuration.  This
will result in traffic originating from the 6to4 address for which
reply traffic will not be accepted.

     # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
     # ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \
             prefixlen 16 alias deprecated link0
     # route add -inet6 2002:: -prefixlen 16 ::1
     # route change -inet6 2002:: -prefixlen 16 ::1 -ifp stf0

Fix: 

Use "anycast" rather than "deprecated" so that the kernel will
choose a different IPv6 source address.

     # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
     # ifconfig stf0 inet6 2002:8504:0506:: prefixlen 16 alias anycast link0
     # route add -inet6 2002:: -prefixlen 16 ::1
     # route change -inet6 2002:: -prefixlen 16 ::1 -ifp stf0

I tested this on a FreeBSD 4.11 box but I don't believe this part of the
stack has changed much since then.  The above documentation is from
FreeBSD 8.
How-To-Repeat: 
Configure the system as above and try to talk to any a machine with
a 6to4 address.  You can observe the traffic with tcpdump.

e.g. "tcpdump -i ne0 -n -p not udp and not tcp and not arp" will
remove most of the extranious packets.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:28 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped