LinuxQuestions.org
Help answer threads with 0 replies.
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 11-01-2014, 03:24 PM   #1
fritz001
Member
 
Registered: Aug 2004
Posts: 176

Rep: Reputation: 18
Exclamation iptables - port forward


Hello all,

Here is my setup:

VM1 [ eth0 bridged, eth1 = VMNET5 ]
eth0: 10.10.1.1
eth1: 100.100.1.1
iptables enabled

VM2
eth0: 100.100.1.2 [ eth0 = VMNET5 ]
iptables enabled

both machines running on rhel 6

So, from an external machine if I'm doing ssh 10.10.1.1 -p 22122 got conn timedout.


Have ANY idea how to do it ?
 
Old 11-01-2014, 04:35 PM   #2
fritz001
Member
 
Registered: Aug 2004
Posts: 176

Original Poster
Rep: Reputation: 18
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 22122 -j DNAT --to 100.100.1.2:22
 
  


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
Iptables can't port forward (PAT Port address translation) sfrederiksen Linux - Networking 7 12-20-2011 10:47 AM
If I forward a port in iptables, does the port have to be open on the firewall? qwertyjjj Linux - Server 4 08-06-2009 09:22 AM
IPTables port forward help matux Linux - Networking 1 09-09-2008 10:54 AM
IPTABLES port Forward abhijeetudas Linux - Networking 1 12-02-2005 04:00 AM
IPTABLES port forward wanaka Linux - Security 3 09-28-2004 07:07 PM

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

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