2f30.org website
git clone git://git.2f30.org/divzeroweb
Log | Files | Refs | README | LICENSE

commit 6a8c2f073b59789870289a9d4af77bb868f07bf5
parent 0bc680efb68c032abad31db56aefe6203929fe60
Author: sin <sin@2f30.org>
Date:   Wed, 30 Apr 2014 16:10:26 +0100

Add trunk failover setup for OpenBSD

Aguides/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 + +/etc/hostname.<wired-if>: + + up + +/etc/hostname.<wireless-if>: + + nwid <ESSID> + wpakey <your-key> + chan <your-channel> + up + +/etc/hostname.trunk0: + + trunkproto failover + trunkport <wired-if> + trunkport <wireless-if> + inet NONE media 100baseTX mediaopt full-duplex + +Setting up the wired and wireless interfaces is straightforward and not +particularly interesting. +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 netmask 0xffffff00 broadcast + inet6 fe80::92e6:baff:fe74:e38%trunk0 prefixlen 64 scopeid 0x5 + +That's all :) + +Cheers! + +sin@