• Welcome to Hurricane Electric's IPv6 Tunnel Broker Forums.

What is the prefixlen used for when assigning an IP?

Started by jollino, December 12, 2010, 08:18:06 AM

Previous topic - Next topic

jollino

Hello all,
this is porbably a very stupid question, but please bear with me. :)

I have a routed /64 (and actually a routed /48, and boy do I feel guilty for getting it assigned just for tests...), and on my main machine I have set up a "static" address to immediately recognize it when it comes up. Following the guides, I configure it by passing a prefixlen of 64, ie.: ifconfig en0 inet6 2001:470:26:2ad::1984 prefixlen 64.
The question is: does it serve any practical purpose, other than reminding that the network block it belongs to is a /64? I'm asking because if I use "prefixlen 128", ie. one host, it works just as fine.

Also, as a side note, what if I wanted to assign a whole bunch of addresses to a given interface, without going through them individually? Let's say I want to have everything from 2001:470:26:2ad:aaaa:bbbb:cccc:0 to 2001:470:26:2ad:aaaa:bbbb:cccc:ffff (ie. 2001:470:26:2ad:aaaa:bbbb:cccc::/112) to one machine, for some reason. Is there a way to quickly do it?

Thanks!

Shameless ego-boost: my photography on Facebook and on Flickr!

cholzhauer

Quote
The question is: does it serve any practical purpose, other than reminding that the network block it belongs to is a /64? I'm asking because if I use "prefixlen 128", ie. one host, it works just as fine.

Someone please correct me if I'm wrong, but I would imagine it would affect routing.  If you told the machine that it was a /128, it wouldn't know that the rest of the /64 lived on the same interface.

jimb

The whole /64 vs. /128 thing is something that has been debated  a lot.  The current recommendation is to just use /64s.  Fretting about how much address space you are using is considered "IPv4 thinking".  The IPv6 address range is simply vast.  Using /64s on a p-t-p interface is perfectly acceptable.

I don't know of a way to assign an entire range of IPv6s to a NIC without adding them individually. 

jollino

Quote from: cholzhauer on December 12, 2010, 08:21:58 AM
Someone please correct me if I'm wrong, but I would imagine it would affect routing.  If you told the machine that it was a /128, it wouldn't know that the rest of the /64 lived on the same interface.

Well, that's something handled by the routing table... I'm talking about the actual interface. Perhaps operating systems use that as a hint to automatically configure the routing table? I'll have to make some tests.

Shameless ego-boost: my photography on Facebook and on Flickr!

kcochran

Quote from: jollino on December 14, 2010, 04:55:15 PM
Well, that's something handled by the routing table... I'm talking about the actual interface. Perhaps operating systems use that as a hint to automatically configure the routing table? I'll have to make some tests.

Interface IPs wind up as connected routes.  Ultimately there are three families of routes: connected, static and dynamic.  Connected are what the system knows it is directly attached to, and will always win.  Statics are deliberately configured, and dynamic are learned via RIP, OSPF, IS-IS, BGP, etc. and will usually be the least preferred.

cholzhauer

Quote from: kcochran on December 14, 2010, 05:31:52 PM
Quote from: jollino on December 14, 2010, 04:55:15 PM
Well, that's something handled by the routing table... I'm talking about the actual interface. Perhaps operating systems use that as a hint to automatically configure the routing table? I'll have to make some tests.

Interface IPs wind up as connected routes.  Ultimately there are three families of routes: connected, static and dynamic.  Connected are what the system knows it is directly attached to, and will always win.  Statics are deliberately configured, and dynamic are learned via RIP, OSPF, IS-IS, BGP, etc. and will usually be the least preferred.

Right, the system uses the connected routes to help set up the overall routing table