Configure tun

You will do some basic configuration of routing on computer A and of the tun interface on computer B.

On computer A

Configure the IPv4 and IPv6 routes to the networks handled by the tun interface of computer B:

# add an IPv4 route to the 10.2.0.0/255.255.0.0 network
route ADD 10.2.0.0 MASK 255.255.0.0 10.1.0.2

# add an IPv6 route to bbbb::/64 network
netsh interface ipv6 add route bbbb::/64 "IEEE802.3" aaaa::2

On computer B

Use the netsh command to set the IPv4 and IPv6 addresses of your tun interface.

netsh interface ipv4 add address name=OpenWSN address=10.2.0.1 mask=255.255.0.0
netsh interface ipv6 add address interface=OpenWSN address=bbbb::1/64

Enable forwarding on both the Ethernet and tun interfaces of the Windows Vista computer, so your computer routes ping commands back-and-forth between them.

# for IPv4
netsh interface ipv4 set interface interface=IEEE802.3 forwarding=enabled
netsh interface ipv4 set interface interface=OpenWSN forwarding=enabled

# for IPv6
netsh interface ipv6 set interface interface=IEEE802.3 forwarding=enabled
netsh interface ipv6 set interface interface=OpenWSN forwarding=enabled

You can not ping your tun interface since no application is attached yet. You'll see in your network connection window that it appears as "disconnected".

The tap-windows driver knows about IPv6, and since it is used to abstract away a complete prefix, it can spoof IPv6 neighbor solicitations if you configure the next hop to fe80::8.

This configuration is important. Without it, the ping response script will not work.

Enter the following commands to remove the default route (if any), and install a new one, with next hop fe80::8.

netsh interface ipv6 delete route bbbb::/64 OpenWSN
netsh interface ipv6 add    route bbbb::/64 OpenWSN fe80::8