LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-09-2024, 07:16 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Rep: Reputation: 10
Post OpenVPN both as a server and as a client


Hello,
Is the following scenario possible?
Quote:
Outside Server (OpenVPN Server) ---> Intermediate Server (OpenVPN Client + OpenVPN Server) ---> Client (OpenVPN Client)
Clients must connect indirectly to the outside server. The intermediate server plays the role of OpenVPN client for the external server and OpenVPN server for the clients.

Thank you.
 
Old 02-09-2024, 12:50 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,707

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
The only reason I can see for this structure is to add complexity and additional points of failure.
Why would you want this?
 
Old 02-10-2024, 12:26 PM   #3
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by wpeckham View Post
The only reason I can see for this structure is to add complexity and additional points of failure.
Why would you want this?
Hello,
Thank you so much for your reply.
  1. Due to some issues, I don't want clients to connect directly to the server.

  2. Hide the number of connections to the outside server.

Last edited by Jason.nix; 02-10-2024 at 12:27 PM.
 
Old 02-10-2024, 10:12 PM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,707

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
Quote:
Originally Posted by Jason.nix View Post
Hello,
Thank you so much for your reply.
  1. Due to some issues, I don't want clients to connect directly to the server.

  2. Hide the number of connections to the outside server.
Would that not be served just as well by simply having the middle server act as a router and route that particular traffic to the internal OpenVPN server?
 
Old 02-12-2024, 05:26 AM   #5
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by wpeckham View Post
Would that not be served just as well by simply having the middle server act as a router and route that particular traffic to the internal OpenVPN server?
Hi,
Thanks again.
Internal server? I think you mean the outside server!
How? Do you mean using something like IPFire?
 
Old 02-12-2024, 10:17 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
You can, from any external router, route UDP traffic sent to a particular port-number to any internal IP-address. So, this is what you do, to send the incoming traffic from external OpenVPN clients to the designated internal server. You don't need to do anything more complicated than that.

"Don't over-think this thing ..." Draw out the various physical-network connections that you require. Then, do the same for the virtual network ("iroute").
 
1 members found this post helpful.
Old 02-12-2024, 11:52 AM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,707

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
Quote:
Originally Posted by sundialsvcs View Post
You can, from any external router, route UDP traffic sent to a particular port-number to any internal IP-address. So, this is what you do, to send the incoming traffic from external OpenVPN clients to the designated internal server. You don't need to do anything more complicated than that.

"Don't over-think this thing ..." Draw out the various physical-network connections that you require. Then, do the same for the virtual network ("iroute").
Exactly the kind of thing I meant. No matter if the edge device is your own make, FOSS, or commercial, this is normally a supported function and avoids having an extra decryption,encryption step at the edge device. Keeping things simple makes them far more reliable.
 
Old 02-13-2024, 08:25 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
When I set up my last VPN network for a client, I literally took out a large piece of paper and a number-two pencil (my two favorite programming tools ... ...) and drew a map of what I wanted everything to be. Then, looking continuously at that map, I figured out what the various settings needed to be and set them.

(I actually took a loose-leaf notebook and the same pencil, and wrote them all out, first carefully checked my work against the map, and then used this as a reference while I twiddled with hardware and files.)

There are, as I have said, two networks to consider. The first is the physical network, as seen by the VPN and non-VPN routers and firewalls. The second is the virtual network, which is what is to be seen by the various clients when the VPN is in service. The first involves physically-routable addresses, and is invisible and irrelevant to the users. The second involves non-routable addresses (e.g. "10.x.y.z"), and is what the protected users see and use so long as the VPN is up.

"The right time to figure out 'what is the right thing to do,' is well before(!) you are trying to do it."

---
(Past-life experience): "What are you doing?" "I'm drawing a flowchart!" (By hand.)

Last edited by sundialsvcs; 02-13-2024 at 08:29 AM.
 
Old 02-14-2024, 12:04 PM   #9
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by sundialsvcs View Post
You can, from any external router, route UDP traffic sent to a particular port-number to any internal IP-address. So, this is what you do, to send the incoming traffic from external OpenVPN clients to the designated internal server. You don't need to do anything more complicated than that.

"Don't over-think this thing ..." Draw out the various physical-network connections that you require. Then, do the same for the virtual network ("iroute").
Hi,
Thank you so much for your reply.
But the virtual NIC that is connected to the OpenVPN server outside must be connected to the virtual NIC that is for clients. Am I wrong?
 
  


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
[SOLVED] How to allow OpenVPN (W10) client to use DNS server (BIND9) that resides on (Ubuntu 16.04) OpenVPN server? grigory Linux - Networking 13 09-17-2019 10:54 PM
should tun0 inet addr match on both server and client? (openvpn) snovosel112811 Linux - Networking 1 01-21-2017 10:20 AM
Should tun0 ip address match on both client and server (openvpn) snovosel112811 Linux - Newbie 1 01-19-2017 08:10 PM
configuring openvpn in same network (i.e client and server both are in same netwrk) eshi14 Linux - Networking 4 10-31-2009 12:46 AM
openvpn server and client cannot ping both direction odie_chan Linux - Networking 0 07-08-2006 12:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:12 PM.

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