Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 108143 - IPv6 addresses in /etc/conf.d/net.example should have prefix lengths
Summary: IPv6 addresses in /etc/conf.d/net.example should have prefix lengths
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High minor
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-10-04 21:14 UTC by Lindsay Haisley
Modified: 2005-10-11 08:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lindsay Haisley 2005-10-04 21:14:01 UTC
It's especially important with IPv6 addresses to include the CIDR-style prefix
length when assigning an IPv6 address to an interface.  The net.example file
contains:

# You can also use IPv6 addresses
#config_eth0=(
#       "192.168.0.2/24"
#       "4321:0:1:2:3:4:567:89ab"
#       "4321:0:1:2:3:4:567:89ac"
#)

This should look more like:

# You can also use IPv6 addresses with prefix lengths
#config_eth0=(
#       "192.168.0.2/24"
#       "4321:0:1:2:3:4:567:89ab/64"
#       "4321:0:1:2:3:4:567:89ac/64"
#)

If this isn't done, the prefix length will be assumed to be 0, which fubars ipv6
routing.  The route table will contain a default route with a next hop of "::",
a null address, and ipv6 packets won't get off of the box.  Even if a default
route is picked up by a route advertisement from the network gateway, this route
will be appened to the routing table _after_ the bogus null route and won't be
used until the bogus route is pulled from the routing table.

It might be a good idea to defaut the prefix length to 128 in the network setup
rather than 0 if no prefix length is specified in the spec in /etc/conf.d/net.  
I'm not sure, but I expect that this would solve the technical problem, although
since IPv6 addresses generally require a prefix in their spec, it would probably
be best to provide a hint by suggesting this usage in net.example.

This bit my butt for several hours today until I noticed the zero-length prefix
in the interface table.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2005-10-06 03:10:27 UTC
I've updated the documentation accordingly.

AFAIK IPv6 addresses without a prefix are valid as they default to /0

Will be in baselayout-1.12.0_pre9
Comment 2 Lindsay Haisley 2005-10-06 10:47:42 UTC
(In reply to comment #1)
> I've updated the documentation accordingly.

This oughta solve the problem :-)

> AFAIK IPv6 addresses without a prefix are valid as they default to /0

Yes, they default to /0.  I'm no IPv6 expert, but this doesn't make a whole lot
of sense to me.  Under what conditions could any address on the Internet have a
netmask or prefix length of 0?  This means that there is no gateway for the
address.  A default prefix length of /128 might make more sense since this would
spec a point-to-point address.  The practical problem with having a default
prefix length of 0 is the bogus null gateway that gets put into the routing
table, which fubars routing.  It took a bit of digging to find out where this
bogus entry was coming from.

IPv6 addresses without a prefix length are valid addresses, but they're
basically an incomplete spec for almost all configuration purposes.  If you're
using the address as a target for a connection, that's another matter.
 
> Will be in baselayout-1.12.0_pre9

Thanks!
Comment 3 Roy Marples (RETIRED) gentoo-dev 2005-10-06 12:16:11 UTC
(In reply to comment #2)
> Yes, they default to /0.  I'm no IPv6 expert, but this doesn't make a whole lot
> of sense to me.  Under what conditions could any address on the Internet have a
> netmask or prefix length of 0?  This means that there is no gateway for the
> address.  A default prefix length of /128 might make more sense since this would
> spec a point-to-point address.

If I'm reading IPv6 how-to's correctly /0 is localhost only - which some people
may require. I'm also loath to change defaults unless really necessary.
Comment 4 Lindsay Haisley 2005-10-06 12:53:56 UTC
That makes sense.  IPv6 localhost addresses are added to the routing table at
boot time.  I'm not sure what component does this, but I assume it's the net
startup script.  These are given names by the default /etc/hosts file which is
also set up by the base layout, so all is in order there.

There may be RFC support for assuming a null prefix length if it's not specified
in configuration, I don't know.  Basically, changing the suggested usage is
net.example will solve the problem about which I posted this bug originally :-)

Thanks for your attention to this.
Comment 5 Roy Marples (RETIRED) gentoo-dev 2005-10-06 13:37:13 UTC
(In reply to comment #4)
> That makes sense.  IPv6 localhost addresses are added to the routing table at
> boot time.  I'm not sure what component does this, but I assume it's the net
> startup script.

Actually it's the kernel.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2005-10-11 08:23:08 UTC
Fixed in pre9