LinuxQuestions.org
Review your favorite Linux distribution.
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 01-06-2024, 05:34 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Rep: Reputation: 10
Post Network settings in OpenVPN and firewall


Hello,
1- Is it possible to run all OpenVPN servers on one port? I currently have an OpenVPN server running with an IP address range of 20.20.0.0 on port 2024, now I want to run another server with a different IP address range on the same port as before.

2- Should every OpenVPN server have its own TUN? Can't run all servers on one TUN?

3- I found the following firewall rules on the internet:
Code:
# IF_MAIN=NIC_Name
# IF_TUNNEL=tun0
# YOUR_OPENVPN_SUBNET=10.10.0.0/16
# iptables -I INPUT -p udp --dport 2024 -j ACCEPT
# iptables -A FORWARD -i $IF_MAIN -o $IF_TUNNEL -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A FORWARD -s $YOUR_OPENVPN_SUBNET -o $IF_MAIN -j ACCEPT
# iptables -t nat -A POSTROUTING -s $YOUR_OPENVPN_SUBNET -o $IF_MAIN -j MASQUERADE
Do I have to repeat the above firewall rules for each server?


Thanks.
 
Old 01-12-2024, 01:09 PM   #2
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 don’t run “multiple servers.” Instead, you configure the one server to host multiple virtual subnets.

VPNs customarily use the “UDP” (not “TCP/IP”) at a well-known port number. Do not tamper with these rules.

Note that my response is based on uncertainty as to whether “server” refers to a computer or a process. On each computer there should be only one process.

Further uncertainty for me: “20…” is not a “non-routable address range.”

Last edited by sundialsvcs; 01-12-2024 at 01:12 PM.
 
Old 01-12-2024, 03:15 PM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
The answers you seek: https://openvpn.net/faq/can-i-run-mu...ingle-machine/

If you use TLS-Auth, OpenVPN will reject all packets without a matching certificate.
 
1 members found this post helpful.
Old 01-15-2024, 01:05 AM   #4
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by rkelsen View Post
The answers you seek: https://openvpn.net/faq/can-i-run-mu...ingle-machine/

If you use TLS-Auth, OpenVPN will reject all packets without a matching certificate.
Hello,
Thank you so much for your reply.
According to the following quote from the above URL, each server should have its own unique port and TUN:
Quote:
If you are running 2 or more OpenVPN instances on the same machine, you will need a separate virtual TUN/TAP adapter and a separate port (using the port directive) for each instance.
 
  


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
OpenVPN assigning public & static IPs to pcs/devices behind an OpenVPN client dgonzalezh Linux - Networking 6 07-18-2010 09:50 AM
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 02:20 AM
How does OpenVPN Linux server issues IP and netmask to OpenVPN clients on Windows XP pssompura Linux - Networking 0 12-24-2009 02:42 AM
Error When converting Routing OpenVPN to bridge mode openvpn danmartinj Linux - Software 0 11-06-2009 09:23 AM
OpenVPN Question : connecting 5-6 comps with OpenVPN duryodhan Linux - Networking 7 02-15-2007 10:28 PM

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

All times are GMT -5. The time now is 09:47 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