LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2024, 11:45 PM   #1
gattocarlo
Member
 
Registered: Jan 2020
Posts: 62

Rep: Reputation: Disabled
OpenVPN and port forwarding without SNAT


Hello,

I have two houses with two different ISPs. In one, let's call it A, I have only a very small router running OpenWRT and the only VPN solution available is OpenVPN (I cannot install anything else on this 4/32 toy). OpenVPN connects it to my second house, B, where I have a powerful server.

My idea was to forward SMTP traffic from A to B, since A has a static IP with an appropriate reverse DNS. The forwarding should not include SNAT, since I want to preserve the logs of the connections to the mail server, and I was thinking to use policy routing to route the mail server responses back via the A router.

The problem is that OpenVPN will drop any packet if the source address does not belong to the internal network. I cannot understand why but this seems to be done on purpose:

https://forums.openvpn.net/viewtopic.php?t=32982

https://forums.openvpn.net/viewtopic.php?t=32714

Now, I have no idea how I could achieve my goal given my limitation (even a GRE tunnel is not possible since iproute2 on the small router doesn't have the GRE module). Any suggestion would be greatly appreciated.

Best,
andrea
 
Old 03-18-2024, 04:31 PM   #2
gattocarlo
Member
 
Registered: Jan 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
I found a solution: I was able to install on the router the minimum required to create IP over IP tunnels, so I created an ipip tunnel between the two endpoints of the VPN and I'm now able to redirect external traffic reaching A's router to B's lan, overcoming the limitations of OpenVPN and using policy routing without masquerading the traffic going through the vpn. Nice!

best,
andrea
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ip forwarding with iptables - double forwarding with openVPN?? sousacanfly Linux - Networking 8 01-20-2014 08:49 AM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
Quagga for Linux Routing without SNAT or MASQUERADE. Zepiroth Linux - Networking 1 03-12-2007 11:01 AM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
IPTables - DNAT, SNAT, port forwarding FunkFlex Linux - Security 2 01-15-2002 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration