tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: IPv6 and ND on tap(4)



Hi,

On Fri, Sep 16, 2011 at 04:05:44PM -0400, Greg Troxel wrote:
>    /sbin/route add -inet6 2001:608:4:a053::/64 2001:608:4:a053::1:0
> 
> There is no reason to do this.  Configuring an address automatically
> adds a route covering that prefix.  It should not have worked (gotten a
> route exists error), but either it overwrote or the cloning route was
> missing for some reason (which is the thing to fix).

Ah.

I add the route, because it did not automatically show up (which is one
of the weirdest bits of cross-platform code - half of the platforms auto-
add the "connected" route at ifconfig, and the other half doesn't).

Step by step (without an application having the tap open, just ifconfig):

# netstat -rn |grep tap
# ifconfig tap0
ifconfig: SIOCGIFFLAGS tap0: Device not configured
# ifconfig tap0 create
# netstat -rn |grep tap
# ifconfig tap0 inet6 2001:608:4:a053::1:0/64 up
# netstat -rn |grep tap                         
fe80::%tap0/64                     link#9             UC          0        0    
  -  tap0
fe80::f00b:a4ff:fe00:4dd2%tap0     f2:0b:a4:00:4d:d2  UHL         0        0    
  -  lo0
ff01:9::/32                        link#9             UC          0        0    
  -  tap0
ff02::%tap0/32                     link#9             UC          0        0    
  -  tap0
# ifconfig tap0
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: f2:0b:a4:00:4d:d2
        media: Ethernet autoselect
        inet6 fe80::f00b:a4ff:fe00:4dd2%tap0 prefixlen 64 scopeid 0x9
        inet6 2001:608:4:a053::1:0 prefixlen 64

... so where does the route for the /64 prefix disappear to?

# uname -a
NetBSD zeta.medat.de 5.1_STABLE NetBSD 5.1_STABLE (GENERIC) #0: Tue Feb 15 
15:46:59 CET 2011  
gert%zeta.medat.de@localhost:/hilb31/sparc64.compile/obj/hilb31/netbsd/src/sys/arch/sparc64/compile/GENERIC
 sparc64


As a cross-check, I just tried this on NetBSD 3.1, and indeed, the route
auto-appears on tap0, and ND starts

22:20:00.348908 2001:608:4:a253::1:0 > ff02::1:ff00:2: icmp6: neighbor sol: who 
has 2001:608:4:a253::2

(different prefix deliberately chosen)



>   2001:608:4:a000::/56               2001:608:4:a053::1             UGS       
>   0        0      -  tap0
>   2001:608:4:a053::/64               2001:608:4:a053::1:0           UGS       
>   1        0      -  tap0
> 
> This looks wrong, but is probably due to the previous issues.   Where
> did that /56 come from?

Sorry for being misleading.  That's an extra network that is just to
be routed across the tap0 /64, but I didn't want to modify the output
of "netstat -rn" in any way.


> When doing netstat, do netstat -rn -f inet6 and then filter out what you
> are sure is not relevant, rather than assuming grepping for tap0 will
> show you everything you should look at.

Yes, sorry for that (usually I grep for ":608:4:", knowing that this 
network must only ever appear on tap0, but I wanted to include the fe80
stuff).

Here's "netstat -rn -f inet6" after the ifconfig sequence from above,
excluding everything that has no "tap0" or "2001:608:4:" in it:

2001:608:4:a053::1:0               f2:0b:a4:00:4d:d2  UHL         0        0    
  -  lo0
fe80::%tap0/64                     link#9             UC          0        0    
  -  tap0
ff01:9::/32                        link#9             UC          0        0    
  -  tap0
ff02::%tap0/32                     link#9             UC          0        0    
  -  tap0


> When you configure the address on tap0, it should get a cloning route,
> which will have flags UC.  This should be in generic ethernet code.
> Note that this apparently happened correctly for v4.

Yes, in v4 this all works.

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             
gert%greenie.muc.de@localhost
fax: +49-89-35655025                        
gert%net.informatik.tu-muenchen.de@localhost


Home | Main Index | Thread Index | Old Index