What's new

Make VPN router connect through wan1 on dual wan

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

abiedster

New Around Here
Hello everyone,

I have seen many cases in this forums speaking about this case in particular, I have tried many things but I couldn't get through it,

I will tell you what I've done step by step and if you can help me achieve it I would appreciate it,

I activated my dual wan in Load Balance mode, 3:1 config

First I made the openvpnclient1.postconf script found on this thread : https://www.snbforums.com/threads/s...-to-choose-from-which-to-wan-to-go-out.38146/

I activated SSH and uploaded it to /jffs/scripts and changed the rights to 0777

I enabled " Enable JFFS custom scripts and configs " on my router,

and went to the VPN config and added "local wan1" as you can see it on the screenshot,

at the moment I add this command the VPN is disabled and I can't enable it,

Please note that I have no idea on how to program scripts of any kind, so I'm just trying the simple way avoiding to break my router.

details on my config :

Primary WAN is my ADSL internet connexion
Secondary WAN is my 4G modem

I have some devices that always use VPN and I want those devices to always go through my 4G internet,

my router is an RT-AC86U with merlin Version:384.13

thank you for your help,

Regards

Abdou N.
 

Attachments

  • vpn config.JPG
    vpn config.JPG
    34 KB · Views: 180
You might also possibly try setting up a static route on the WAN routing sections specific to the IP address of the remote server (untested).
 
You might also possibly try setting up a static route on the WAN routing sections specific to the IP address of the remote server (untested).
I forgot to specify that either I put local wan1 or local wan0 none of them works, the VPN stays at OFF and I can't turn it ON
 
Suggestion: update to at least 384.17 of Asuswrt-Merlin, current is 384.19. The .19 version is best installed with a full factory reset because it restructures JFFS - read up before you do this. The .17 version should be a straight upgrade without reset.

Install AMTM script manager, then select and install x3MRouting Script through AMTM menu. here: https://www.snbforums.com/threads/amtm-the-asuswrt-merlin-terminal-menu.42415/

Details on X3MRouting here: https://www.snbforums.com/threads/x3mrouting-selective-routing-for-asuswrt-merlin-firmware.57793/

Read through the X3MRouting info to determine whether it will meet your needs beforehand. The installation has multiple options and use cases. One may suit your need.
 
I forgot to specify that either I put local wan1 or local wan0 none of them works, the VPN stays at OFF and I can't turn it ON
The following is not a valid OpenVPN directive as interface names are not allowed.
Code:
local wan1
However, for my personal convenience, rather than have to tediously manually identify the IP address associated with the target interface I created a custom 'openvpnclientX.postconf' script so that each time the VPN Client is started it substitutes
Code:
local wanX
with the appropriate IP address
Code:
local xxx.xxx.xxx.xxx
and deletes the 'nobind' directive.

NOTE: If there is a DDNS for the WAN interface e.g. wan0 then this DNS reference may be used.

If you have created say '/jffs/openvpnclient1.postconf', and the script is correctly marked as Unix LF format and executable
Code:
chmod +x /jffs/openvpnclient1.postconf

dos2unix /jffs/openvpnclient1.postconf
then there will be messages in Syslog when my custom script '/jffs/openvpnclient1.postconf' executes
Code:
Oct  6 10:17:21 RT-AX56U custom_script: Running /jffs/scripts/openvpnclient1.postconf (args: /etc/openvpn/client1/config.ovpn)

Oct  6 10:17:21 RT-AX56U (openvpnclient1.postconf): 6262 v1.03 Started..... [/etc/openvpn/client1/config.ovpn]
Oct  6 10:17:22 RT-AX56U (openvpnclient1.postconf): 6262 VPN Client 1 will BIND to 10.88.8.251 via virtual interface 'wan0'

Oct  6 10:17:22 RT-AX56U ovpn-client1[6357]: OpenVPN 2.4.9 arm-buildroot-linux-gnueabi [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Jun 28 2020
Oct  6 10:17:22 RT-AX56U ovpn-client1[6357]: library versions: OpenSSL 1.1.1g  21 Apr 2020, LZO 2.08
Oct  6 10:17:22 RT-AX56U ovpn-client1[6358]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Oct  6 10:17:22 RT-AX56U ovpn-client1[6358]: TCP/UDP: Preserving recently used remote address: [AF_INET]xxx.xxx.xxx.xxx:553
Oct  6 10:17:22 RT-AX56U ovpn-client1[6358]: Socket Buffers: R=[524288->524288] S=[524288->524288]

Oct  6 10:17:22 RT-AX56U ovpn-client1[6358]: UDP link local (bound): [AF_INET]10.88.8.251:1194

Oct  6 10:17:22 RT-AX56U ovpn-client1[6358]: UDP link remote: [AF_INET]xxx.xxx.xxx.xxx:553
Oct  6 10:17:22 RT-AX56U ovpn-client1[6358]: TLS: Initial packet from [AF_INET]xxx.xxx.xxx.xxx:553, sid=b9612015 64401b12

<snip>

Oct  6 10:17:27 RT-AX56U (vpnclient1-route-up): 6723 User Processing Complete.
Oct  6 10:17:27 RT-AX56U ovpn-client1[6358]: Initialization Sequence Completed

P.S. I haven't used Dual-WAN for a while, so this is untested with v384.19 given the underlying OpenVPN related module changes.
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top