# Asus - OpenVPN Site to Site or Point to Point

ASUS Asuswrt Merlin

Most of the documents online are missing steps or the folks writing the document are assuming that the folks setting this up are network traffic wizards.

### GOAL:

With one of the Asus routers being the server and the other being a client, we want to be able from either side hit IPs or hostnames of any of any device.

#### Both Routers:

**VPN Type:** TUN as TAP maybe overkill for this case

**Protocol:** UDP

**Static Routes:** Both servers

When you export the OpenVPN certificates from the router (as opposed to supplying your own), they have the CN set as ‘**client**’. This is relevant/confusing for the server config, as our other router is a client named client.

#### Server:

ASUS RT-AC5300 with 192.168.53.1/24

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-interface-type-tun%C2%A0t" width="100%"><tbody><tr><th><a class="hintstyle">Interface Type</a></th><td>TUN TAP</td></tr><tr><th><a class="hintstyle">Protocol</a></th><td>TCP UDP</td></tr><tr><th><a class="hintstyle">Server Port</a></th><td> <span class="hint-color">(Default : 1194)</span></td></tr><tr id="bkmrk-authentication-mode-"><th><a class="hintstyle">Authentication Mode</a></th><td><span data-darkreader-inline-color="" id="bkmrk-tls%C2%A0static-key">TLS Static Key</span></td></tr><tr id="bkmrk-keys-and-certificate"><th>Keys and Certificates</th><td></td></tr><tr id="bkmrk-username%2Fpassword-au"><th>Username/Password Authentication</th><td>Yes No</td></tr><tr id="bkmrk-tls-control-channel-"><th><a class="hintstyle">TLS control channel security  
*(tls-auth / tls-crypt)*</a></th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="9de95ca07aac019a" name="vpn_server_hmac"> <option value="-1">Disable</option> <option value="2">Bi-directional Auth</option> <option value="0">Incoming Auth (0)</option> <option value="1">Outgoing Auth (1)</option> <option selected="selected" value="3">Encrypt channel</option> </select></td></tr><tr><th><a class="hintstyle">HMAC Authentication</a></th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="a44ddaa69b2f539e" name="vpn_server_digest"><option value="default">Default</option><option value="none">None</option><option value="MD5">MD 5</option><option value="SHA1">SHA 1</option><option value="SHA224">SHA 224</option><option value="SHA256">SHA 256</option><option value="SHA384">SHA 384</option><option value="SHA512">SHA 512</option><option value="RIPEMD160">RIPEMD 160</option><option value="RSA-MD4">RSA MD4</option></select></td></tr><tr id="bkmrk-vpn-subnet-%2F-netmask"><th><a class="hintstyle">VPN Subnet / Netmask</a></th><td> </td></tr><tr id="bkmrk-advertise-dns-to-cli"><th><a class="hintstyle">Advertise DNS to clients</a></th><td>Yes No</td></tr><tr id="bkmrk-data-ciphers"><th>Data ciphers</th><td></td></tr><tr><th><a class="hintstyle">Compression</a></th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="77a340f4b916b22a" name="vpn_server_comp"> <option value="-1">Disable</option> <option value="no">None</option> <option value="yes">LZO</option> <option selected="selected" value="adaptive"> LZO Adaptive</option> <option value="lz4">LZ4</option> <option value="lz4-v2">LZ4-V2</option> </select></td></tr><tr><th>Log verbosity</th><td> <span class="hint-color">(Between 0 and 6. Default: 3)</span></td></tr><tr id="bkmrk-manage-client-specif"><th>Manage Client-Specific Options</th><td>Yes No</td></tr><tr id="bkmrk-allow-client-%3C-%3E-cli"><th><a class="hintstyle">Allow Client &lt;-&gt; Client</a></th><td>Yes No</td></tr><tr id="bkmrk-allow-only-specified"><th><a class="hintstyle">Allow only specified clients</a></th><td>Yes No</td></tr></tbody></table>

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable_table" id="bkmrk-allowed-clients-comm" width="100%"><thead><tr><td colspan="5">Allowed Clients</td></tr></thead><tbody><tr><th width="36%"><a class="hintstyle" id="bkmrk-"></a>Common Name(CN)</th><th width="20%"><a class="hintstyle" id="bkmrk--1"></a>Subnet</th><th width="20%"><a class="hintstyle" id="bkmrk--2"></a>Mask</th><th width="12%"><a class="hintstyle" id="bkmrk--3"></a>Push</th><th width="12%">Add / Delete</th></tr><tr><td width="36%"></td><td width="20%"></td><td width="20%"></td><td width="12%"><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="fcc04e0ea97985a0" name="vpn_clientlist_push_0"> <option selected="selected" value="0">No</option> <option value="1">Yes</option> </select></td><td width="12%"></td></tr></tbody></table>

<div id="bkmrk-client-192.168.51.0-"><table align="center" cellpadding="4" cellspacing="0" class="list_table" id="bkmrk-client-192.168.51.0--1" width="100%"><tbody><tr id="bkmrk-client-192.168.51.0--2"><td width="36%">client</td><td width="20%">192.168.51.0</td><td width="20%">255.255.255.0</td><td width="12%">Yes</td><td width="12%"></td></tr></tbody></table>

</div><table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable_table" id="bkmrk-custom-configuration" width="100%"><thead><tr><td>Custom Configuration</td></tr></thead><tbody><tr><td>reneg-sec 432000  
push "route 192.168.53.0 255.255.255.0"  
route 192.168.51.0 255.255.255.0</td></tr></tbody></table>

Custom Explained:

```bash
reneg-sec 432000 #optional
push "route 192.168.53.0 255.255.255.0" #server LAN IP
route 192.168.51.0 255.255.255.0 #client LAN IP
```

Export the .ovpn files from the new server config


#### Client:

ASUS RT-AC5300 with 192.168.51.1/24

**Import** .ovpn config file exported from server, to set the certificates and some of the basic settings.

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-select-client-instan" width="100%"><tbody><tr id="bkmrk-select-client-instan-1"><th>Select client instance</th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="6897d4d394291a87" name="vpn_client_unit"> <option value="1">1: Site-to-Site HOUSE</option><option value="2">2: Client 2</option><option value="3">3: Client 3</option><option value="4">4: Client 4</option><option value="5">5: Client 5</option></select></td></tr><tr id="bkmrk-service-state"><th>Service state</th><td><div class="left" id="bkmrk--4"><div class="iphone_switch_container">![](https://b938e6c24dbcfb5e001dbaa8f3eae8ca2.asuscomm.com:8443/switcherplugin/iphone_switch_container_on.png)</div></div><div id="bkmrk--6"></div></td></tr><tr><th>Automatic start at boot time</th><td>Yes No</td></tr><tr><th>Description</th><td></td></tr><tr><th>Import .ovpn file</th><td> </td></tr></tbody></table>

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-network-settings-int" width="100%"><thead><tr><td colspan="2">Network Settings</td></tr></thead><tbody><tr><th><a class="hintstyle">Interface Type</a></th><td>TUN TAP</td></tr><tr><th><a class="hintstyle">Protocol</a></th><td>TCP UDP</td></tr><tr><th>Server Address and Port</th><td><label>Address:</label>XXXXXXX.asuscomm.com  
<label>Port:</label><span data-dashlanecreated="true" id="bkmrk--8"></span></td></tr><tr id="bkmrk-create-nat-on-tunnel"><th>Create NAT on tunnel</th><td>Yes No <span id="bkmrk-routes-must-be-confi">Routes must be configured manually.</span></td></tr><tr><th><a class="hintstyle">Inbound Firewall</a></th><td>Block Allow</td></tr><tr id="bkmrk-accept-dns-configura"><th><a class="hintstyle">Accept DNS Configuration</a></th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="8169eeddd1faa3db" name="vpn_client_adns"> <option selected="selected" value="0">Disabled</option> <option value="1">Relaxed</option> <option value="2">Strict</option> <option value="3">Exclusive</option> </select></td></tr><tr><th><a class="hintstyle">Redirect Internet traffic through tunnel</a></th><td colspan="2"><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="dca656e495c64af4" name="vpn_client_rgw"> <option value="0">No</option><option value="1">Yes (all)</option><option value="2">VPN Director (policy rules)</option></select></td></tr></tbody></table>

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-authentication-setti" width="100%"><thead><tr><td colspan="2">Authentication Settings</td></tr></thead><tbody><tr><th><a class="hintstyle">Authentication Mode</a></th><td>TLS Static Key</td></tr><tr id="bkmrk-username%2Fpassword-au-1"><th>Username/Password Authentication</th><td>Yes No</td></tr></tbody></table>

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-crypto-settings-keys" width="100%"><thead><tr><td colspan="2">Crypto Settings</td></tr></thead><tbody><tr><th>Keys and Certificates</th><td></td></tr><tr id="bkmrk-data-ciphers-1"><th>Data ciphers</th><td></td></tr><tr id="bkmrk-tls-control-channel--1"><th><a class="hintstyle">TLS control channel security  
*(tls-auth / tls-crypt)*</a></th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="5df2e1f71e98aa43" name="vpn_client_hmac"> <option value="-1">Disabled</option> <option value="2">Bi-directional Auth</option> <option value="0">Incoming Auth (0)</option> <option value="1">Outgoing Auth (1)</option> <option selected="selected" value="3">Encrypt Channel</option> <option value="4">Encrypt Channel V2</option> </select></td></tr><tr><th><a class="hintstyle">Auth digest</a></th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="802b6d2292e36fbb" name="vpn_client_digest"> <option value="default">Default</option><option value="none">None</option><option value="DSA">DSA</option><option value="DSA-SHA">DSA-SHA</option><option value="DSA-SHA1">DSA-SHA1</option><option value="DSA-SHA1-old">DSA-SHA1-old</option><option value="ecdsa-with-SHA1">ecdsa-with-SHA1</option><option value="MD4">MD4</option><option value="MD5">MD5</option><option value="MDC2">MDC2</option><option value="RIPEMD160">RIPEMD160</option><option value="RSA-MD4">RSA-MD4</option><option value="RSA-MD5">RSA-MD5</option><option value="RSA-MDC2">RSA-MDC2</option><option value="RSA-RIPEMD160">RSA-RIPEMD160</option><option value="RSA-SHA">RSA-SHA</option><option value="RSA-SHA1">RSA-SHA1</option><option value="RSA-SHA1-2">RSA-SHA1-2</option><option value="RSA-SHA224">RSA-SHA224</option><option value="RSA-SHA256">RSA-SHA256</option><option value="RSA-SHA384">RSA-SHA384</option><option value="RSA-SHA512">RSA-SHA512</option><option value="SHA">SHA</option><option value="SHA1">SHA1</option><option value="SHA224">SHA224</option><option value="SHA256">SHA256</option><option value="SHA384">SHA384</option><option value="SHA512">SHA512</option><option value="whirlpool">whirlpool</option></select></td></tr></tbody></table>

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-advanced-settings-lo" width="100%"><thead><tr><td colspan="2">Advanced Settings</td></tr></thead><tbody><tr><th>Log verbosity</th><td> <span class="hint-color">(Between 0 and 6. Default: 3)</span></td></tr><tr><th>Compression</th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="a019b2ddee94ddba" name="vpn_client_comp"> <option value="-1">Disabled</option> <option value="no">None</option> <option value="yes">LZO</option> <option selected="selected" value="adaptive"> LZO Adaptive</option> <option value="lz4">LZ4</option> <option value="lz4-v2">LZ4-V2</option> <option value="stub">Stub</option> <option value="stub-v2">Stub-V2</option> </select></td></tr><tr id="bkmrk-tls-renegotiation-ti"><th><a class="hintstyle">TLS Renegotiation Time</a></th><td> <span class="hint-color">(in seconds, -1 for default)</span></td></tr><tr><th>Connection Retry attempts</th><td> <span class="hint-color">(0 for infinite)</span></td></tr><tr id="bkmrk-verify-server-certif"><th>Verify Server Certificate Name</th><td><select class="input_option" data-dashlane-classification="other" data-dashlane-rid="9ab8fbdd910764ff" name="vpn_client_tlsremote"> <option selected="selected" value="0">No</option> <option value="1">Common Name</option> <option value="2">Common Name Prefix</option> <option value="3">Subject</option> </select></td></tr></tbody></table>

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable_table" id="bkmrk-custom-configuration-1" width="100%"><thead><tr><td>Custom Configuration</td></tr></thead><tbody><tr><td>resolv-retry infinite  
float  
keepalive 15 60  
remote-cert-tls server</td></tr></tbody></table>

Applied the "automatic start at boot time"

Turn on the client VPN

#### Server Connection:

<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable" id="bkmrk-openvpn-server-2%C2%A0--r" width="100%"><thead><tr><td>OpenVPN Server 2<span data-darkreader-inline-bgcolor="" data-darkreader-inline-bgimage="" id="bkmrk-%C2%A0--running"> - Running</span></td></tr></thead><tbody><tr><td data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top=""><div id="bkmrk-clients-common-nameu"><table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable_table" width="100%"><thead><tr><td colspan="6">Clients</td></tr></thead><tbody><tr><th>Common Name  
<span data-darkreader-inline-bgcolor="" data-darkreader-inline-bgimage="" data-darkreader-inline-color="">Username</span></th><th>Real Address  
<span data-darkreader-inline-bgcolor="" data-darkreader-inline-bgimage="" data-darkreader-inline-color="">Virtual Address</span></th><th>MBytes Received</th><th>MBytes Sent</th><th>Connected Since</th></tr><tr><td>client  
</td><td>XXX.XXX.XXX.XXX:47361  
<span data-darkreader-inline-bgcolor="" data-darkreader-inline-bgimage="" data-darkreader-inline-color="">10.100.100.2</span></td><td>7305.28</td><td>2561.14</td><td>2024-12-22 09:49:57</td></tr></tbody></table>

  
<table align="center" border="1" cellpadding="4" cellspacing="0" class="FormTable_table" style="height: 566.141px;" width="100%"><thead><tr style="height: 29.7969px;"><td colspan="4" style="height: 29.7969px;">Routes</td></tr></thead><tbody><tr style="height: 29.7969px;"><th style="height: 29.7969px;">Virtual Address</th><th style="height: 29.7969px;">Common Name</th><th style="height: 29.7969px;">Real Address</th><th style="height: 29.7969px;">Last Ref</th></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.217C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:29</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.1C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:31</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.15C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:36</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">10.100.100.2</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:50</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.109C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:28</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.145C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:50</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.10C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:31</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.101C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:25</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.140C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:40</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.9C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:50</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">192.168.51.23C</td><td style="height: 29.7969px;">client</td><td style="height: 29.7969px;">XXX.XXX.XXX.XXX:47361</td><td style="height: 29.7969px;">2024-12-22 11:03:44</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;"> </td></tr></tbody></table>

</div></td></tr></tbody></table>


### Confusion:

The problem is that from the server I cannot access the the LAN on the client side without adding a route vis the JFFS scripts folder using the "nat-start" script.

```bash
#!/bin/sh
#https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts
#
DATE=$(date +"%Y-%m-%d-%H%M%S")
echo "deleting the route to router if it exists" $DATE >> /tmp/nat-start.log
route delete -net 192.168.51.0 netmask 255.255.255.0 gw 10.100.100.2
echo "done deleting the route" $DATE >> /tmp/nat-start.log
echo "adding route to router" $DATE >> /tmp/nat-start.log
route add -net 192.168.51.0 netmask 255.255.255.0 gw 10.100.100.2
echo "done adding route to router" $DATE >> /tmp/nat-start.log
```

#### References:

[https://medium.com/@kylemattimore/asuswrt-merlin-openvpn-tunnel-site-to-site-69b9011b079a](https://medium.com/@kylemattimore/asuswrt-merlin-openvpn-tunnel-site-to-site-69b9011b079a)

[https://www.senia.org/2018/03/12/router-to-router-vpn-tunnel-using-asus-routers/](https://www.senia.org/2018/03/12/router-to-router-vpn-tunnel-using-asus-routers/)

[https://www.asus.com/us/support/faq/1011706/](https://www.asus.com/us/support/faq/1011706/)