OpenBSD Journal

New Feature Alert: trunk(4)

Contributed by todd on from the redundant-redundancy dept.

First released in OpenBSD 3.8, trunk(4) is used to aggregate multiple network interfaces as one virtual trunk interface. In English, this means you take two network cards, plug them both into the same (or a different switch) and you continue functioning even if you unplug one. As released in 3.8, the trunk(4) interface implemented a simple roundrobin protocol.

New in -current, there is a failover protocol. This permits specifying one of the network cards as the master, and a secondary one to be used if the primary one is observed to be unplugged. One ingenious use of this new feature is for users who bridge their wireless network and wired networks. One may use a trunk interface to assign the IP address of a laptop. The trunk interface then in turn uses the ethernet interface of the laptop as master, and the wireless interface as the failover port. Unplugging the laptop to go sit in the breeze on the porch permits no connections to be reset, while returning to plugin the wired network permits a download from a local server to greatly increase in speed.

Servers will likely want round-robin which also permits to aggregate bandwidth. This means faster than 100mbit speeds with multiple 100mbit ethernet cards, for example.

With a `super redundant setup' of failover trunking, one can setup a system with 6 nics in each of two machines and several switches that result in a super resilient setup in which no one piece of equipment (including a switch) failing will permit loss of traffic.

(Comments are closed)

  1. By Anonymous Coward ( on

    Ingenious? true, but has not this been in Linux a long time..

    1. By Anonymous Coward ( on

      I'll take every feature in OpenBSD that gets put in. Personally, I don't care if Linux has it or not, I still ain't using Linux.

    2. By Marco Peereboom ( on

      Yeah it is! in a .o file.

      Open source, who needs it?

        1. By Marco Peereboom ( on

          Nice try! If you want something that actually works you need the intel closed source crap. Besides GPL is nearly as bad as a .o.

          Please take your linux tripe elsewhere. We don't care.

        2. By Anonymous Coward ( on

          Sure. But the remark was about trunking wireless and wired interfaces together. Most wireless drivers are binary only on linux.

    3. By Anonymous Coward ( on

      I don't know much about Linux anymore (don't care to to be honest) but so what if it's in other OS's (Windows, Linux kernel, Solaris, etc. etc.), this is in OpenBSD and as always gives OpenBSD much greater potential than the previous release(s).

    4. By Shane J Pearson ( on

      Ingenious? true, but has not this been in Linux a long time..

      Many people who appreciate OpenBSD, appreciate that much thought goes into features well before they are implemented. So that the implementation is done properly. A nice new feature is added to OpenBSD and then some guy has to come in and say "doesn't Linux already do this?". Many people here will be thinking, "who cares", since they have come to appreciate the cleanliness and correctness which OpenBSD strives for.

      I know personally for myself and I would imagine others would also feel, that this appreciation is all the stronger because many would have come to OpenBSD from the quirky nature of Linux.

      I don't mind how long OpenBSD might take to get some feature, because I know when it gets it, it will be functional, secure and concise in both code and documentation.

    5. By Anonymous Coward ( on

      And many features of Linux were already in Windows or Unix or Solaris or...

      What's your point?

    6. By Anonymous Coward ( on

      "Ingenious? true, but has not this been in Linux a long time.."

      Take your Linux PR crap and shove it up a Windows user, they need it more.

      This is a OpenBSD place, we don't need your crap here. Nor do we care.

      I use all sorts of OSs, and I always use OpenBSD for firewalls and any other application where security is primary.

      This trunking feature seems interesting.

    7. By geek00L ( on

      I wonder why there's always a guy who has no idea claiming something here. No one will bother what you have in your linux world, we are more care about what OpenBSD offers, no one will ever listen to you and it's waste of your stupid efforts here. And since you are anonymous coward, keep yourself coward, silence and don't speak like a coward. I use all sort of Operating Systems too, and I'm always happy if there's new feature implemented in the Operating System.

    8. By pete gilman ( on

      "Ingenious? true, but has not this been in Linux a long time.. "

      maybe, but in openbsd it's:

      a) properly implemented

      b) truly free and open

      c) well-documented with a man page written by someone who speaks english properly

      hint: openbsd users aren't interested in who does it first, we're interested in who does it right.

      1. By Anonymous Coward ( on

        well-documented with a man page written by someone who speaks english properly

        Thanks for me (poor french people) for 90% of the world !

  2. By Matthias Kilian ( on

    ... continue functioning even if you unplug one.

    I thought the proper way to disrupt a network connection were to cut the cable using an axe. At least there are rumours that certain OpenBSD developers tend to prefer this method ;-)

      1. By suspect ( on

        oh god, the guy is crazy

      2. By Matthias Kilian ( on

        Thanks (wth didn't I find those pictures myself?)

        Oh, and Wim: what about selling hardware network disruption tools with nice OpenBSD logos at booths next year?

  3. By Anonymous Coward ( on

    Yeah, this is definitely a nice new feature.
    Here's how I have my laptop setup...
    $ cat /etc/hostname.trunk0
    !ifconfig trunk0 trunkproto failover netmask
    $ cat /etc/hostname.gem0
    !ifconfig trunk0 trunkport $if
    $ cat /etc/hostname.wi0
    !ifconfig trunk0 trunkport $if
    $ cat /etc/hotplug/attach                                                       
    case $class in
            ifconfig $name up
            ifconfig trunk0 trunkport $name

  4. By Chad Loder ( on

    Has anyone benchmarked the performance of bandwidth aggregation?

    1. By Anonymous Coward ( on

      Something that would be interesting to me is the ability to have a VPN operate over multiple links. Typically you might have a cable modem and a DSL modem, each with separate IP addresses. So you'd need to have, if I understand correctly, two separate VPN tunnels setup. Can OpenBSD be setup so that a failure in one network seamlessly fails over to the other?

  5. By marklar ( on


    Cisco uses:
    Etherchannel = multiple physical ports, Trunk = multiple vlans
    Everyone else:
    Trunk = multiple physical ports, ? = multiple vlans

    1. By Booms ( on

      Ah, yes... we all love Cisco's adherance to standards. I believe "link aggregation" is the vendor neutral term, and IIRC the standard is 802.1ad, but I don't see that mentioned in the man pages anywhere.

      Does anyone know if this new feature is standards compliant? How does traffic make it back to the OpenBSD box from the switch - is there a shared MAC on both interfaces? Is your speed inbound to the system limited by a single link, or will the switch balance traffic back to the box over both links as well?

      Lots of questions, but definitely a useful feature, and will be very handy for many applications.

      1. By djm@ ( on

        No, it doesn't yet support 802.3ad (LACP). It is a very overcomplex protocol to do quite a simple thing. -d

        1. By Jason Wright ( on

          C'mon, we support 802.1d STP, what's so hard about 802.3ad? =)

      1. By Anonymous Coward ( on

        Yawn, not interesting.

      2. By Anonymous Coward ( on


  6. By Jim ( on

    Or am I asking too much. I'm not well versed in networking details so this could be a _really_ dumb question.

    1. By corentin ( on

      Yes; you can use a trunk interface as you would use any other type of network interface.

  7. By Anonymous Coward ( on

    So does it support 802.3ad Trunking? Most modern switches sopport 802.3ad, so I hope the tun interface does/will.

    1. By Anonymous Coward ( on

      sorry I meant the 'trunk' interface

      1. By Anonymous Coward ( on

        Please read comment "djm@ (IP on Sat Dec 24 06:08:20 2005 (GMT)" above.

  8. By Anonymous Coward ( on

    I too am curious, what if any are the requirements for configuration on Ethernet switches (or hubs?) to support either mode of trunk(4)?

    1. By Anonymous Coward ( on

      Simple: they do not require any configuration at all.

      1. By cameronsto ( on

        For failover this is correct, but for bandwidth aggregation I believe the switch does need to support trunking.


  9. By Anonymous Coward ( on

    trunk(4) says:

    The following example uses an active failover trunk to set up roaming between wired and wireless networks using two network devices. Whenever the wired master interface is unplugged, the wireless failover device will be used:

    # ifconfig em0 up
    # ifconfig ath0 netmask nwid my_net
    # ifconfig trunk0 trunkproto failover trunkport em0 trunkport ath0 \
    > netmask

    where it is indicated which one interface is the master? by the wording it seems to be em0, but OTOH may be it is ath0? or is it always the first interface given to the ifconfig? if so, it should be said explicitly, no? the man page for ifconfig is no help in this department also...


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]