This was inspired by tunbridge(1). The reason I can't just use a bridge(4) device is because some properties of packets are preserved in copying them around the kernel and a userland set of tun(4) devices connected to each other avoids this nicely. If something else does this same task 'better' let me know, until then, there is tuncat(1). tuncat(1) is developed on OpenBSD but it should work on other BSDs. HOW TO INSTALL % make # make install HOW TO SET UP The system must be configured to send packets to the tun device and properly handle reinjected packets. Care should be taken not to create a loop for reinjected packets. The following example shows a simple pf.conf(5) to redirect packets destined to a specific host to the emulated link. tun_if = "tun0" int_if = "em0" pass in quick on $int_if route-to $tun_if from any to 192.0.2.1 In order to forward reinjected packets, packet forwarding needs to be enabled, which usually needs the following line in /etc/sysctl.conf. net.inet.ip.forwarding=1 HOW TO USE The following exmaples demonstrates how to use tuncat(1). To emulate a link. tuncat -n /dev/tun0 -o /dev/tun1 CHANGES 2005/05/31 version 0.1 for beta test