Hurricane Electric's IPv6 Tunnel Broker Forums

Advanced search  

News:

Welcome to Hurricane Electric's Tunnelbroker.net forums!

Author Topic: What is the prefixlen used for when assigning an IP?  (Read 8965 times)

jollino

  • Newbie
  • *
  • Posts: 33
  • Photographer by passion, hacker by instinct
    • Daniele Nicolucci Photography
What is the prefixlen used for when assigning an IP?
« on: December 12, 2010, 08:18:06 AM »

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!
Logged

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

cholzhauer

  • Hero Member
  • *****
  • Posts: 2724
Re: What is the prefixlen used for when assigning an IP?
« Reply #1 on: December 12, 2010, 08:21:58 AM »

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.
Logged

jimb

  • Hero Member
  • *****
  • Posts: 805
  • ^^^ Warped picture
Re: What is the prefixlen used for when assigning an IP?
« Reply #2 on: December 12, 2010, 12:14:30 PM »

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. 
Logged

jollino

  • Newbie
  • *
  • Posts: 33
  • Photographer by passion, hacker by instinct
    • Daniele Nicolucci Photography
Re: What is the prefixlen used for when assigning an IP?
« Reply #3 on: December 14, 2010, 04:55:15 PM »

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.
Logged

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

kcochran

  • Sr. Network Engineer, Hurricane Electric
  • Administrator
  • Sr. Member
  • *****
  • Posts: 418
Re: What is the prefixlen used for when assigning an IP?
« Reply #4 on: December 14, 2010, 05:31:52 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.
Logged

cholzhauer

  • Hero Member
  • *****
  • Posts: 2724
Re: What is the prefixlen used for when assigning an IP?
« Reply #5 on: December 14, 2010, 05:51:40 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
Logged