FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
387 views 6 comments
by anonymous

Hi,

I am wondering if anyone knows how to bind an OpenVPN client to the wwan0 / mob1s1a1 interface? The reason is, I wish to ping over this tunnel (which is behind CGNAT) to monitor connection quality. Normally, OpenVPN client establishes the tunnel via wan/eth1 interface.

I have seen mention of using --local or --local-dev directives in the openvpn conf file but these don't seem to work for me or, I am using them wrong.

Can anyone help?

1 Answer

0 votes
by anonymous

Hi,

I assume your wired WAN/eth1 is your main WAN connection. Try editing your OpenVPN instance in the WebUI. Add the following option in the extra field:

  • --bind-dev wwan0

I have tried this with WLAN and eth1 and it seemed to work fine.

Let me know if this works for you.

Kind Regards,

Andzej

by anonymous
Hi

Thank you, I had seen that option but thought it was only for openvpn 2.6 (and RUTOS has 2.5.x I think). Anyway I tried it but for me it wasn't working as expected- because I am using preconfigured .ovpn file maybe. I added `bind-dev wwan0` line directly to my .ovpn config and re-uploaded it. But it seems somewhere on the backend, OpenWRT changes the option to `bind-dev tun_c_<mytunnelname>`

In the end for now I am using some hotplug scripts to configure static routes, it's working ok but definitely requires some manual setup.
by anonymous

Hi,

In the ovpn file this option is with the hyphens in front:

  • --bind-dev wwan0

However, this might not work when you upload the ovpn file.

Anyways, when you upload a file, a new instance is created and added to the /etc/config/openvpn file.

Could you try editing that file? 

  • vi /etc/config/openvpn

Find your instance and add the following:

  • list _extra '--bind-dev wwan0'

Make sure to restart the service:

  • /etc/init.d/openvpn restart

Alternatively, you can just restart the device.

Let me know if this works.

Kind Regards,

Andzej

by anonymous

Hello @Andzejj

Unfortunately no, it does not work. I tried editing the /etc/config/openvpn and adding list _extra '--bind-dev wwan0' as you suggested, and after that didnt' work, I edited /etc/vuci-uploads/cbid.openvpn.XXXX.configXXXX.ovpn directly and added `bind-dev wwan0` but that also did not work. This is with the latest Firmware 7.4 now

by anonymous

Hi,

Sorry for the late reply.

Indeed. It appears that the system has difficulty interpreting the bind-dev option when an ovpn file is used, and as a result, it sets '--bind-dev tun'.

However, if you change the dev and bind-dev options in ovpn file as follows:

  • --dev tun
  • --bind-dev wwan0

It should work. Let me know if this works for you.

Kind Regards,

Andzej

by anonymous

Should I be including the ` -- ` ? (usually when using file config, you don't add the -- part).

by anonymous
Hi,

Yes and yes. Usually, you don't add these, but it works this way in this case. Just tried.

Let me know about the results.

Kind Regards,

Andzej