Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    OpenVPN tap device failure (possible bug?)

    Scheduled Pinned Locked Moved OpenVPN
    2 Posts 1 Posters 5.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      virtualstudios
      last edited by

      Hello, I have recently trying to configure my pfSense to use a Site-to-Site OpenVPN tunnel to a vpn provider of mine.
      I successfully connect to the provider and gets a ip address but I can't get it assigned on the tap device.

      
      tap1: flags=8842 <broadcast,running,simplex,multicast>metric 0 mtu 1500
      	options=80000 <linkstate>ether 00:xx:xx:xx:xx:xx</linkstate></broadcast,running,simplex,multicast> 
      

      My suspections is that the tap-device that goes under the name "tap1" isn't noticed since it runs "ifconfig tap x.x.x.x.x x.x.x.x.x" etc but the the real device
      is tap1. So it throws out this message.

      
      openvpn[50606]: TUN/TAP device [b]/dev/tap1 opened[/b]
      openvpn[50606]: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
      openvpn[50606]: /sbin/[b][color]ifconfig tap[/color][/b] x.x.x.x netmask 255.255.255.128 mtu 1500 up
      openvpn[50606]: FreeBSD ifconfig failed: external program exited with error status: 1
      
      

      If I enter the "ifconfig-noexec" command in the advanced options I successfully get rid of the error (to the extent that I can't route any traffic through vpn).
      But I see that it communicates with the vpn provider and it doesn't affect any connection problems or anything.

      To note is that I get the same one with the "route" command i.e when it want's to add routes around.
      When I add the "ifconfig-noexec" command it passes through the previous error I posted above and instead spits this out.

      
      openvpn[26065]: [b]TUN/TAP device /dev/tap1 opened[/b]
      openvpn[26065]: /usr/local/sbin/ovpn-linkup tap 1500 1574 x.x.x.x 255.255.255.128 init
      openvpn[26065]: /sbin/route add -net x.x.x.x x.x.x.x 255.255.255.255
      openvpn[26065]: /sbin/route add -net 0.0.0.0 x.x.x.x 128.0.0.0
      openvpn[26065]: ERROR: FreeBSD route add command failed: external program exited with error status: 1
      openvpn[26065]: /sbin/route add -net 128.0.0.0 x.x.x.x 128.0.0.0
      openvpn[26065]: ERROR: FreeBSD route add command failed: external program exited with error status: 1
      
      

      If I add both "ifconfig-noexec" and "route-noexec" into advanced options it connects to the vpn provider and gives me a IP but it doesn't assign it to tap nor does it add the routes (obviously since I said that it shouldn't use those two commands).
      But has anybody found a solution to this problem?

      I have tried editing the /conf/config.xml file as stated in a forum post I found here and changed to but it didn't do any good.
      I have done numerous of restarts and checked logs every time.

      Here is my advanced options:

      
      dev tap
      dev-type tap
      verb 5
      user root
      proto udp
      port 1194
      resolv-retry infinite
      ca /etc/ca.crt
      auth-user-pass /etc/openvpn-password.txt
      persist-tun
      persist-key
      redirect-gateway def1
      
      

      Really thankful for any help I could get!

      1 Reply Last reply Reply Quote 0
      • V
        virtualstudios
        last edited by

        I have managed to fix it by passing "dev tap1" instead of "dev tap" in the advanced configs.
        (stupid misstake)

        Now my interface connected to tap1 gets the ip from the vpn provider but it doesn't pass it through to my gateway so I can't connect to the internet.
        My gateway has the ip-address set to "dynamic" and the interface is set to the one getting the address from tap1. But all it says is "gathering data".

        Edit:
        Problem solved. I simply changed back to default gateway and then back to the vpn gateway and it worked.
        Oh boy, I have learnt a lot today about what could be wrong with this, hopefully I can have it working a while now :)

        Thanks for a great software PFSENSE team!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.