IPv6

Enabling IPv6 and PNRP in Windows Vista

Win­dows Vista is the first ver­sion of Win­dows to sup­port IPv6 out of the box. Even those of us with an IPv4 con­nec­tion can make use of this, using a tech­nol­ogy called Teredo to get IPv6 con­nec­tiv­ity over IPv4. With Google fi­nally get­ting IPv6, now seems like a good time for oth­ers to start too.

The steps to en­able IPv6 are sim­ple:

  1. Open up a com­mand prompt with ad­min­is­tra­tor priv­i­leges. Start->All Pro­grams->Ac­ces­sories, right click on Com­mand Prompt and se­lect Run as ad­min­is­tra­tor.
  2. If you aren’t on a router, or if your router sup­ports UPNP, enter netsh interface teredo set state client.
  3. If you want to man­u­ally for­ward a port or your router doesn’t sup­port UPNP, enter netsh interface teredo set state client clientport=12345, sub­sti­tut­ing 12345 with the port you want to use. You will have to for­ward UDP over this port to your com­puter.
  4. Now wait for a minute or so and run netsh interface teredo show state. It should show “qual­i­fied” under State.
  5. Now if you run ip­con­fig, it should come up with a Tun­nel adapter Local Area Con­nec­tion with an IPv6 ad­dress start­ing with 2001:0.
  6. You can test if it’s work­ing by vis­it­ing Google IPv6, or the KAME pro­ject’s fa­mous danc­ing kame.

Now for the sec­ond part of the post. PNRP (Peer Name Res­o­lu­tion Pro­to­col) ver­sion 4.0 was also in­tro­duced in Win­dows Vista. With PNRP, every com­puter can have a host­name point­ing to it that al­lows any XP SP2, Vista, and Server 2008 com­puter to con­nect to it via the in­ter­net. This can be in­cred­i­bly use­ful if you’re on the go and wish to re­mote in to your com­puter. An­other use I’ve found for it is to en­able it on rel­a­tive’s PCs for those in­evitable tech sup­port calls that we geeks de­spise so much.

PNRP func­tions solely over IPv6, so you will need to have a valid IPv6 ad­dress to make it work. The above Teredo in­struc­tions should work fine if you don’t. Here’s how you en­able it:

  1. Open up a com­mand prompt with ad­min­is­tra­tor priv­i­leges.
  2. Run the com­mand netsh p2p pnrp peer set machinename publish=start autopublish=enable.
  3. Now if you run netsh p2p pnrp peer show machinename, it should show you a host­name to use in the for­mat p.<ran­dom hex here>.​pnrp.​net. Record this name, and you can use it to talk to your ma­chine re­motely just like any other host­name.

De­vel­op­ers aren’t left out ei­ther: Win­dows comes with an ex­ten­sive P2P frame­work, and PNRP is only one of the things built on it. WCF for in­stance has full in­te­gra­tion with P2P.