Author: sin <firstname.lastname@example.org>
Date: Wed, 30 Apr 2014 16:10:26 +0100
Add trunk failover setup for OpenBSD
|guides/trunk.md|| | ||72||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
1 file changed, 72 insertions(+), 0 deletions(-)
diff --git a/guides/trunk.md b/guides/trunk.md
@@ -0,0 +1,72 @@
+### Trunk failover setup on OpenBSD
+I have a single machine at home that I use it mainly for sending and
+receiving e-mails. The machine has one wired interface as well as a
+wireless interface. My wired interface goes over powerline adaptor.
+For various reasons every once in a while, the powerline adaptor loses
+sync and as a result I cannot access my machine remotely.
+One way to solve this problem is to take advantage of the wireless interface
+and transparently switch over to it when the wired interface becomes unavailable.
+To do this we'll use a simple form of interface aggregation, also known as
+trunk failover. For the gory details please refer to:
+ man 4 trunk
+#### Setting up the interfaces
+ nwid <ESSID>
+ wpakey <your-key>
+ chan <your-channel>
+ trunkproto failover
+ trunkport <wired-if>
+ trunkport <wireless-if>
+ inet 192.168.1.2 255.255.255.0 NONE media 100baseTX mediaopt full-duplex
+Setting up the wired and wireless interfaces is straightforward and not
+Our trunk setup is using the failover mode and is specified via `trunkproto`.
+We have two allocated ports, the master port is hooked up to the wired interface
+and the failover port is attached to the wireless interface.
+In my setup I use a static IP address for the trunk interface but it is also
+possible to use DHCP.
+At this point restart the interfaces:
+ # sh /etc/netstart
+#### Testing the trunk interface
+Generate some network activity by copying a large file via scp and pull the
+RJ45 cable from your machine. The copy operation might stall but it will automatically
+fallthrough to the wireless interface. If you plug your ethernet cable back in
+it will switch automatically back to the wired interface.
+A sample ifconfig follows from my particular setup:
+ trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ lladdr 90:e6:ba:74:0e:38
+ priority: 0
+ trunk: trunkproto failover
+ trunkport athn0
+ trunkport alc0 master,active
+ groups: trunk egress
+ media: Ethernet autoselect
+ status: active
+ inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
+ inet6 fe80::92e6:baff:fe74:e38%trunk0 prefixlen 64 scopeid 0x5
+That's all :)