LinuxQuestions.org
Visit Jeremy's Blog.
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 04-01-2014, 10:09 AM   #1
setevoy
LQ Newbie
 
Registered: Oct 2013
Location: Kiev, UA
Distribution: CentOS
Posts: 10

Rep: Reputation: Disabled
traffic redirection by domain name to external addresses


Hi.

We using Linux CentOS.

For example - we have 3 hosts - host1.domain.com, host2.domain.com, host3.domain.com. Hosts connected via VPN.

Task: host1.domain.com must be a gateway for http/https traffic, and redirect requestes to host2.domain.com and host3.domain.com.

host1.domain.com will have external IP and accepts request on 80 port.

host2.domain.com and host3.domain.com - internal IP and accepts request on 8080 and 8443 ports.

How this can be realised? IPTABLES, NGINX, something else?

And - what about other traffic? SSH, samba etc.

Thanks.
 
Old 04-01-2014, 10:37 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Check this website have explanation to configure nginx as reverse proxy.
http://www.cyberciti.biz/tips/using-...rse-proxy.html

Do you need SSH and Samba access via your external IP? if not just restrict SSH and Samba access on your local network only.
 
1 members found this post helpful.
Old 04-01-2014, 11:02 AM   #3
setevoy
LQ Newbie
 
Registered: Oct 2013
Location: Kiev, UA
Distribution: CentOS
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks, @kirukan - I'm also assume to use NGINX to redirect HTTP traffic.

But also - I want to redirect SSH, MySQL and Oracle traffic from external network - to internal servers in this VPN network. Can it be done?

For examle - I'm in external network and want open connection to MySQL database servers in this VPN network.

Lets assume that MySQL server #1 have IP 10.0.0.2 (internal) and MySQL server #2 have IP 10.0.0.3 (internal).

host1.domain.com - have IP 77.120.120.77 (external) and 10.0.0.1 (internal).

I want to have ability open connection to MySQL server #1 via request like "open host2.domain.com:3306" and MySQL server #2 via request like "open host3.domain.com:3306".

Thanks for tips.
 
Old 04-01-2014, 11:44 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Let me draw a picture about your setup. I guess you would like to setup a web-based application by using Nginx, Apache, Mysql/Oracle. So here Nginx is going to be a reverse proxy, Apache is the middleware and Mysql/Oracle are the Back-end.

As per your earlier posts all these servers are in your internal network so Nginx, Apache and Mysql/Oracle can talk each other.

Configure the external IP in nginx. whoever access your web application from internet they first hit nginx then nginx will handle those HTTP/HTTPS connections.

So you don't want to expose your real web application and database servers to public.

If I am wrong make it bit more clear about your questions...

Last edited by kirukan; 04-01-2014 at 11:46 AM.
 
Old 04-01-2014, 11:59 AM   #5
setevoy
LQ Newbie
 
Registered: Oct 2013
Location: Kiev, UA
Distribution: CentOS
Posts: 10

Original Poster
Rep: Reputation: Disabled
Not exactly. Web-application (Tomcat in fact) - it is one story.

Other applications (database servers, LDAP, SSH access) - other one.

So, speaking about MySQL access - means that I want really open direct connection to different MySQL (or any other service) servers in internal - from external network.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Odd traffic over all IP addresses. What's going on? Zippy1970 Linux - Security 14 07-23-2012 12:50 PM
[SOLVED] Traffic redirection using iptables wooly Linux - Newbie 7 11-23-2010 08:29 PM
Redirection of a domain to a subtree of another domain alenoosh Linux - Server 1 08-10-2010 11:28 PM
traffic redirection issue guillermo Linux - Networking 4 08-04-2008 05:20 PM
Intranet traffic restriction/redirection pircio Linux - Networking 2 02-17-2005 10:24 AM

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

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