OpenBSD Journal

OpenVPN 2.0 on OpenBSD HOWTO

Contributed by grey on from the because sometimes you don't want to use ipsec dept.

Thanks to Jonathan for the following submission, which may interest some of our readers:

I've written a HOWTO for OpenVPN 2.0 on OpenBSD. It covers configuration in bridging and in routing mode. It is available here:

(Comments are closed)

  1. By m0th ( on

    the URL is invalid due to expired session id. when do you guys learn to remove session ids from URLs pasted in stories? when will use some more advanced session management?


    1. By m0th ( on

      well, clicking on the URL included in the story itself everything is fine,

      BUT the rss-feed (which actually informed me of this new article) includes a expired session id to this story. why is that?

      thanks, again.

  2. By mirabile ( on

    Did you ever experience any crashes with OpenVPN?

    I have tested an OpenVPN tunnel from behind an ADSL router at home
    to a dedicated server at a hoster. In Germany, most ADSL
    providers disconnect the line every 12 or 24 hours, with an
    instant re-dial-in possible (you get a different IPv4 tho).

    Related to that, I got crashes - usually the VPN server crashed
    first, the client later. I nailed that down to the tun(4)
    device [used in tun or tap (link2) mode, no matter] by replacing
    OpenVPN with netcat and ksh.

    I also got more crashes with IPv6 (on the interior of the tunnel)
    than without.

    Admittedly, I did not do these tests with pristine OpenBSD, but
    a friend did. He got the same crashes as I did with OpenVPN but
    didn't do much further testing. He even got _some_ (but not as
    many) crashes with IPsec.

    Maybe there's something in the routing code broken?

    We used host routes like Kili wrote once to mark the route to
    the "outer side" gateway, like this:

    route -n add -inet -host -interface -link vr0:
    route -n add -inet default -mtu 1454

    I tested disconnecting by manually killing the ppp(8) on the
    ADSL router then restarting it (ifconfig down/up for pppoe(4) is
    the equivalent). If people can reproduce that, I would be
    glad if they can sort that out with the OpenBSD developers;
    my kernel coding experience is basically nonexistent I admit.

    1. By Hans Hoexer ( on

      > Admittedly, I did not do these tests with pristine OpenBSD, but
      > a friend did. He got the same crashes as I did with OpenVPN but
      > didn't do much further testing. He even got _some_ (but not as
      > many) crashes with IPsec.
      Could your friend be so kind and read and then provide a proper report for those IPsec crashes? Thanks.

      1. By Nikademus ( on

        I am sorry, but OpenVPN is _not_ part of the normal OpenBSD installation, it's rather installed by source/ports/packages. It is also _not_ based on IPsec, so writing a report to OpenBSD team will just be another useless move. Reporting to OpenVPN developpers would be a better idea.

        1. By Anonymous Coward ( on

          Maybe you should try reading first, and then commenting after that. He says his friend experienced crashes with ipsec as well.

          I have run openbsd ipsec VPNs over horrible links that go down for minutes at a time several times a day with no problems though, so I wonder if maybe he just had bad hardware.

          1. By phessler ( on

            considering there was no information about the crashes, we don't know if they were caused by the same thing. not to mention the fact that the OPs openbsd is *not* stock. the request to report them to the openvpn people is appropriate.

            1. By Anonymous Coward ( on

              Again, read first, then comment. He clearly said his friend was the one getting ipsec crashes, and that it was stock openbsd. Yes, those should be reported to openbsd, and not openvpn.

            2. By mirabile ( on

              Sure, mine were not on stock OpenBSD, that's why I didn't report.
              The crashes were total freezes; since I was in X11 at that time
              I don't know if there was a ddb. The server was remote, and I did
              not see anything in the syslog after it came back up (probably due
              to the crash). I did not, at that time, have means to gather
              console output.

              But I could (in my tests) reproduce them with netcat instead of
              OpenVPN, that's why they were definitively not OpenVPN's fault.

              I did, however, get some strange routing messages, that's why I
              suppose there is (or was?) a problem with routing.

              I don't have boxen to throw OpenBSD on for testing, though. (In
              fact, I even can't afford a new coffee machine at the moment, and
              my old one is broken... but that's off-topic.)

              That's why it seemed natural for me to post it here, where
              maybe others who have seen similar things can step in. If
              I wanted to submit a bug report I had done different things.

              I also recall wbx telling me about some crashes when he tested
              OpenVPN first, but I don't want to put words in his mouth and
              I don't remember the exact problems.

        2. By Hans Hoexer ( on

          As one maintainer of OpenBSDs IPsec implementation I'd like to know about problems regarding IPsec.

    2. By Jonathan ( on

      I never had any problems with crashes but I use OpenVPN only for my WLAN and not over DSL/ppp. Although, I use a PowerBook with OS X as a client and when it goes to sleep that's like a disconnect. When the machine is up again everything works just fine, the tunnel is reestablished after some seconds. The OS X client is Tunnelblick.

    3. By phessler ( on

      I have had zero problems with openvpn. Unix, OSX and Windows clients. Over WAN, DSL, Cable, and other connections (some with bad loss, some with zero loss). To be fair though I have not attempted any IPv6 over it, mostly because we do not have IPv6 setup inside the network openvpn connects to.

      1. By amirm ( on

        I have encountered quite a few especially with PF and some issues with the tunX if. I will report them soon to OpenVPN people when i get the exact reproduction method written down. Mine have to do with bridging mode.

  3. By Charles Hill ( on

    The entire site seems to be gone.


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.]