Re: How to turn off IPV6 (link local)

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

 



On Fri, 2004-06-18 at 07:47, Pekka Savola wrote:
> Jeroen: I'm using Red Hat's 2.4.20 kernels (RHL73 and RHL9).  I'm
> having difficulty testing this more widely, as almost everywhere where
> I have a Linux box, I also have IPv6 routes ;-)

I know about that 'no boxes without IPv6 routes' problem, same here ;)

> I just tested this again: after 'modprobe ipv6' and no RA, after a
> couple of seconds, the default routes were added on all the
> interfaces.  When I restarted RA's, the default routes were removed,
> replaced by the default route in the RA.

/me just remembered he had a redhat box stashed somewhere and amaze:

$ ip -6 ro
<SNIP others>
default dev eth1  proto kernel  metric 256  mtu 1500 advmss 1440
default via fe80::207:4fff:fef7:fd dev eth0  proto kernel  metric 1024 
expires 1731sec mtu 1500 advmss 1440
unreachable default dev lo  proto none  metric -1  error -101

A default route on eth1 while we have a real one on eth0.
Thus some searching in the kernel:

From: 2.4.20/net/ipv6/addrconf.c
   1575                 printk(KERN_DEBUG "%s: no IPv6 routers
present\n",
   1576                        ifp->idev->dev->name);
   1577
   1578                 memset(&rtmsg, 0, sizeof(struct in6_rtmsg));
   1579                 rtmsg.rtmsg_type = RTMSG_NEWROUTE;
   1580                 rtmsg.rtmsg_metric = IP6_RT_PRIO_ADDRCONF;
   1581                 rtmsg.rtmsg_flags = (RTF_ALLONLINK |
RTF_ADDRCONF |
   1582                                      RTF_DEFAULT | RTF_UP);
   1583
   1584                 rtmsg.rtmsg_ifindex = ifp->idev->dev->ifindex;
   1585
   1586                 ip6_route_add(&rtmsg, NULL);

Here we go, a default route because there is no IPv6 router.
Explains exactly the behaviour above.

Oddly enough this is also on 2.6.7 and in 2.4.17. I thus wonder why I
never have seen this behavior, which is in one word: bad.
And this little piece of code should really be removed.

The only scenario where this could be handy is where one configures a
lot of addresses on one box, any other box on the same link can then
still reach it. This could be the case when RA failed maybe, still I
don't like this mechanism at all.

Greets,
 Jeroen

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux