<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OpenVPN routing question]]></title><description><![CDATA[<p dir="auto">Hi everyone,<br />
I have a problem with routing traffic trough openVPN. After days of reading and testing, i am posting this and hope someone could help. I think i am almost done, there is missing just a small piece.</p>
<p dir="auto">We have an pfsense with openvpn server (Azure Cloud) This is located in the cloud and should only connect all VPN clients<br />
One pfsense as openvpn client (Site A)<br />
One pfsense as openvpn client (Site B)<br />
more sites with openvpn clients will be added in future<br />
not all sites should be able to communicate with each other</p>
<p dir="auto">LAN 172.16.0.0/23 &lt;----&gt; pfsense site A ----&gt; pfsense Site C (VPN Server) &lt;---- pfsense site B  &lt;----&gt; LAN 172.16.254.0/24</p>
<p dir="auto">Clients in Site A need to connect to clients in Site B<br />
Clients in Site B need to connect to clients in Site A</p>
<p dir="auto">On the Server in Cloud is no LAN which need to be accessible. This Server should just connect the VPN tunnels from all clients.</p>
<p dir="auto">I start a ping from LAN of site A to a client of site B and opposite.</p>
<p dir="auto">What I see is that in the VPN server the ICMP packets are seen in the tunnelinterface coming from booth ends. But going out the default gateway to the LAN.</p>
<p dir="auto">This is the ovpns1 interface</p>
<pre><code>13:29:56.406750 IP 172.16.254.20 &gt; 172.16.0.55: ICMP echo request, id 29701, seq 24576, length 40
13:30:00.070629 IP 172.16.0.55 &gt; 172.16.254.254: ICMP echo request, id 1, seq 35209, length 40

</code></pre>
<p dir="auto">and this is the traffic leaving the local LAN interface (hn0)</p>
<pre><code>14:19:20.597774 IP 172.16.0.55 &gt; 172.16.254.254: ICMP echo request, id 1, seq 35855, length 40
14:19:20.721167 IP 172.16.254.20 &gt; 172.16.0.55: ICMP echo request, id 29701, seq 43522, length 40

</code></pre>
<p dir="auto">How can i set routing and tell the VPN Server to route the packets from one VPN client to the other?</p>
<p dir="auto">What i have tried is changing the servertype from Peer to Peer to Remote Access and enable Interclient communication. Then it is working.<br />
But what i read is, that then i have no way to restrict traffic only between certain clients and all sites see each other which should not be the case.</p>
<p dir="auto">What is the prefered setup for this szenario?</p>
<p dir="auto">Thanks and best regards<br />
Thomas</p>
]]></description><link>https://forum.netgate.com/topic/152806/openvpn-routing-question</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 03:40:36 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/152806.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Apr 2020 15:05:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OpenVPN routing question on Thu, 23 Apr 2020 14:21:33 GMT]]></title><description><![CDATA[<p dir="auto">I use CSO already.</p>
<p dir="auto">Site A has a route entry for the remote site, rest is set by CSO</p>
<pre><code>route 172.16.254.0 255.255.255.0;
</code></pre>
<p dir="auto">Site B does not have any routes they are set by CSO</p>
<p dir="auto">Server has this:</p>
<pre><code>route 172.16.254.0 255.255.255.0 192.168.98.2;
route 172.16.0.0 255.255.254.0 192.168.98.3;
</code></pre>
<p dir="auto">I need this, to get the packets back to the OpenVPN interface</p>
<p dir="auto">CSO for Site A on server is this:</p>
<pre><code>iroute 172.16.0.0 255.255.254.0;
ifconfig-push 192.168.98.2 255.255.254.0;
</code></pre>
<p dir="auto">i need to set static IP's for the route entry in the previous step</p>
<p dir="auto">CSO for Site B on server is this:</p>
<pre><code>iroute 172.16.254.0 255.255.255.0;
push "route 172.16.0.0 255.255.254.0";
ifconfig-push 192.168.98.3 255.255.254.0;
</code></pre>
<p dir="auto">reason for the difference of site A and B is that Site A have the Option "don't pull routes enabled". So instead of a push route in CSO, i have the route option on the client directly.</p>
<p dir="auto">It is working like this.</p>
<p dir="auto">However, I have the feeling that it should be possible without setting static tunel IP's.</p>
<p dir="auto">If i use the remote network box, the routes that are added are then pointing all to the same tunnel.</p>
<p dir="auto">Btw. is there any way to show the learned OpenVPN iroutes. The only way i found was via the logs which is a pain if you miss the correct moment.</p>
]]></description><link>https://forum.netgate.com/post/907457</link><guid isPermaLink="true">https://forum.netgate.com/post/907457</guid><dc:creator><![CDATA[ThomasWW]]></dc:creator><pubDate>Thu, 23 Apr 2020 14:21:33 GMT</pubDate></item><item><title><![CDATA[Reply to OpenVPN routing question on Thu, 23 Apr 2020 11:42:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomasww">@<bdi>ThomasWW</bdi></a> said in <a href="/post/907379">OpenVPN routing question</a>:</p>
<blockquote>
<p dir="auto">We expecting to have hundert or more clients in future.</p>
</blockquote>
<p dir="auto">So you have to go with an access server and set up CSO.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomasww">@<bdi>ThomasWW</bdi></a> said in <a href="/post/907379">OpenVPN routing question</a>:</p>
<blockquote>
<p dir="auto">Downside is, that i have to define the gateway (tunnel IP of the client) in the route entries on the server.</p>
</blockquote>
<p dir="auto">With CSO that should not be needed. You can enter the clients network in the "Remote Networks" box to set the route.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/thomasww">@<bdi>ThomasWW</bdi></a> said in <a href="/post/907379">OpenVPN routing question</a>:</p>
<blockquote>
<p dir="auto">Is there a possibility to tell the server, that packets not leaving tun interface on server and route directly to the correct vpn tunnel?<br />
Should not openVPN getting this information from the iroute statement?</p>
</blockquote>
<p dir="auto">That's done by the Remote Networks in the CSO. But I don't know by now if packet filtering between clients is possible with that. You will have to try.</p>
]]></description><link>https://forum.netgate.com/post/907402</link><guid isPermaLink="true">https://forum.netgate.com/post/907402</guid><dc:creator><![CDATA[viragomann]]></dc:creator><pubDate>Thu, 23 Apr 2020 11:42:12 GMT</pubDate></item><item><title><![CDATA[Reply to OpenVPN routing question on Thu, 23 Apr 2020 08:14:13 GMT]]></title><description><![CDATA[<p dir="auto">Unfortunately we cannot setup 1 server per client. We expecting to have hundert or more clients in future.<br />
Yes, remote networks are setup correctly.</p>
<p dir="auto">I'm one step ahead and disable "client-client mode". Routing is working properly with additional steps.<br />
Downside is, that i have to define the gateway (tunnel IP of the client) in the route entries on the server.<br />
192.168.98.1 = tunnel IP server<br />
192.168.98.2 = tunnel IP site A<br />
192.168.98.3 = tunnel IP site B</p>
<pre><code>route 172.16.254.0 255.255.255.0 192.168.98.2;
route 172.16.0.0 255.255.254.0 192.168.98.3;
</code></pre>
<p dir="auto">AS tunnel IP's can change, now i need to assign static IP's to clients in client specific overrides with ifconfig-push.</p>
<p dir="auto">Now traffic flows from client Site A through tunnel. On server it is send through tun interface to kernel and from kernel back to tun interface and through the other tunnel to Site B.</p>
<p dir="auto">This looks not so efficient and have addition administrative overhead.<br />
Is there a possibility to tell the server, that packets not leaving tun interface on server and route directly to the correct vpn tunnel?<br />
Should not openVPN getting this information from the iroute statement?</p>
]]></description><link>https://forum.netgate.com/post/907379</link><guid isPermaLink="true">https://forum.netgate.com/post/907379</guid><dc:creator><![CDATA[ThomasWW]]></dc:creator><pubDate>Thu, 23 Apr 2020 08:14:13 GMT</pubDate></item><item><title><![CDATA[Reply to OpenVPN routing question on Wed, 22 Apr 2020 19:51:02 GMT]]></title><description><![CDATA[<p dir="auto">Are running only one server instance on Azure?<br />
You should have one for each site to site connection.</p>
<p dir="auto">Have you set the "Remote Networks" option?</p>
]]></description><link>https://forum.netgate.com/post/907279</link><guid isPermaLink="true">https://forum.netgate.com/post/907279</guid><dc:creator><![CDATA[viragomann]]></dc:creator><pubDate>Wed, 22 Apr 2020 19:51:02 GMT</pubDate></item></channel></rss>