EtherIP added to NetBSD

Written at evening time in English • Tags: , ,

Hans Rosenfeld ported EtherIP support from OpenBSD to NetBSD 2.0. Today I’ve committed that work to NetBSD-current, to be included in future releases of NetBSD.

EtherIP (RFC-3378) makes it possible to bridge Ethernet networks using tunnels over the Internet. While you could already use tunnels for IP traffic, now they can be used for any Ethernet traffic. I’m looking forward to using the Internet with my friends to play legacy networked games that only use IPX for LAN communication.

To setup a bridged network using tunnels, you need to create gif(4) interfaces for the tunnels, and a bridge(4) interface to connect the tunnels and the Ethernet (LAN) interfaces.

The easiest way to create a tunnel is using an ifconfig.if(5) file, e.g. /etc/ifconfig.gif0:

create mtu 1500
tunnel 169.254.33.145 169.254.176.12
up

You don’t need to assign IP addresses for the tunnel interfaces, if you don’t plan to use them for IP routing. In the above:

  • 169.254.33.145 is your public IP address
  • 169.254.176.12 is the public IP address of the router to the remote network

Reverse the order of the IP addresses on the remote router.

Since the gif(4) interfaces are created on-demand, you cannot use an ifconfig.if(5) file of the bridge(4) interface for adding the gif(4) interfaces. I prefer to do all the bridge setup from /etc/netstart.local instead, as it will be run just after all other network setup has been completed. If the local (internal) network is on ex0, these commands bridge it to the newly created gif0 inteface:

ifconfig bridge0 create
brconfig bridge0 add ex0 add gif0 up

Repeat on the remote router, and you are done. You can use tcpdump(8) to verify that the bridging works.