LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-03-2006, 05:25 PM   #1
nikkac
LQ Newbie
 
Registered: Oct 2006
Posts: 2

Rep: Reputation: 0
Unhappy enabling port forward redirection from single external IP


Hy Guys


I need help with enabling port forward redirection from single external IP port 80 to internal network port 4090.
this rule works for me but as i mentioned above I need to restrict access to only one external IP to be able to communicate to internal network port 4090

iptables -t nat -A PREROUTING -i ppp0 -p tcp -d X.X.X.X --dport 80 -j DNAT --to-destination 192.168.2.25:4090


Thanks in advance
 
Old 10-03-2006, 05:51 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Line like this should work.
iptables -A INPUT -s xxx.xxx.xxx.xxx -p tcp --syn --dport 80 -j ACCEPT
Then use the line you already have after this to route to the internal machine.

Brian1
 
Old 10-04-2006, 03:24 PM   #3
nikkac
LQ Newbie
 
Registered: Oct 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Smile

Thanks a lot for the response.

I was able to achieve this by specifying source IP inside the line:

iptables -t nat -A PREROUTING -i ppp0 -s X.X.X.X -p tcp -d X.X.X.X --dport 80 -j DNAT --to-destination 192.168.2.25:4090

Thanks again
 
  


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
Mail Redirection from external id to internal id ! please help thiyagu4u Linux - Networking 4 07-14-2005 11:38 PM
Port 80 redirection omlex Linux - Security 1 02-20-2005 04:22 PM
Port Redirection JonChristmas Linux - Networking 1 09-04-2004 04:19 AM
How to sniff port redirection shawnzhou888 Linux - Networking 0 07-18-2003 03:31 PM
Forward port port 80 to lan web server dulaus Linux - Networking 9 10-04-2002 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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