LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-07-2012, 11:32 PM   #1
linuxhasib
LQ Newbie
 
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
Question Port forwarding & NAT


I need urgent help:

I need to forward a some ports on a real IP to private IPort

eth0: xxx:xxx:xxx:xxx (real IP)
eth1: 192.168.1.1
working environment: Redhat Linux 5

i need to forward
xxx:xxx:xxx:xxx:2500 to 192.168.1.20:443
xxx:xxx:xxx:xxx:2501 to 192.168.1.30:443
xxx:xxx:xxx:xxx:2502 to 192.168.1.40:443


so that port 443 on those 3 local IPs (...20,30,40) can be accessible
individually from real (out) world through xxx:xxx:xxx:xxx:250n

i tried this way:
iptables -t nat -I PREROUTING -i eth0 -d xxx.xxx.xxx.xxx --dport 2500 -
j DNAT --to 192.168.1.20:443

but it's not working, i need urgent solution... please help
 
Old 02-08-2012, 01:00 AM   #2
scanray
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Rep: Reputation: Disabled
use "A" not "I" in your line.

For me work like that:

iptables -t nat -A PREROUTING -p tcp -i eth0 --destination-port 2500 -j DNAT --to-destination eth1:443


good look
 
  


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
NAT | Port Forwarding MarkRaats Linux - Server 1 05-16-2011 05:39 AM
NAT port forwarding mrittman Linux - Newbie 3 09-28-2009 06:31 PM
NAT and Port Forwarding aq_mishu Linux - Networking 2 09-16-2005 07:58 AM
NAT'ing RC.FIREWALL Script & Port Forwarding Bittorrent wlfdgcrkz Linux - Networking 2 08-24-2004 10:08 PM
Port Forwarding without NAT on an old Kernel linuxpyro Linux - Networking 0 06-02-2004 12:31 PM

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

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