LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-03-2011, 09:52 AM   #1
jack_green
Member
 
Registered: Jul 2011
Posts: 73

Rep: Reputation: Disabled
Unhappy connect PC behind NAT


Hi, guys. I got a big problem. I have one PC which is Ubuntu OS , and the other is RHEL 6.1 OS. I cannot connect Ubuntu to my RHEL 6 which is behind NAT . Any help is appreciated.
 
Old 09-03-2011, 10:07 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
If you have NAT already configured, you must open proper ports, for example if you are mean by connecting a ssh, do on NAT machine:
Code:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 22 -d $IP_OF_NAT_MACHINE -j DNAT --to $IP_OF_SSH_SERVER:22
iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 22 -d $IP_OF_SSH_SERVER -j ACCEPT
Where $IP_OF_NAT_MACHINE and $IP_OF_SSH_SERVER are yours IP addresses and eth0 is your WAN port (where ssh clients are connecting) and eth1 is LAN (where ssh server is connected).

Last edited by eSelix; 09-03-2011 at 10:13 AM.
 
1 members found this post helpful.
  


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
NAT and NAT Server behind its own NAT(private network) zeusys Linux - Networking 1 06-08-2011 06:22 PM
connect apps through NAT to separate intra-net SaintDanBert Linux - Networking 2 12-01-2010 09:34 AM
Can I use NAT and some local hosts without NAT on linux box? tkmbe Linux - Networking 1 08-12-2010 02:38 PM
I'm Connect to OPENVPN but i haven't NAT!!!! sungirl Linux - Networking 1 03-02-2009 11:44 AM
newbie cant connect to clients VPN through my NAT. wachaca Linux - Networking 7 11-26-2008 08:32 AM

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

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