LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-01-2013, 01:17 AM   #1
shiladitya
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Rep: Reputation: Disabled
Post port based nating with iptables


on eth0 port we have public ip and eth1 we have ip 10.31.0.1 which provides dhcp and squid service.Port 8080,53,67,80,443 is open.Now for an application we have to open 1521,8443 port so that it can hit remote server 1521,8443 port. But only opening port is not helping us connect to remote server. So we need to enalble nat for this specific port request. By what iptable command can we accomplish port based nating. Pl guide.
 
Old 10-01-2013, 02:04 AM   #2
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
what you have in your iptables, share the output from iptables -L and iptables -t nat -L
 
Old 10-02-2013, 11:34 PM   #3
shiladitya
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
The server fuction squid proxy server no nat rules are enabled and in input chains the ports 80,443,25,67,53 are opened and in input chain 1521,8443 for application
 
Old 10-03-2013, 05:54 AM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
ok,
so with all info provided i can assume you need to open a port for your application to hit a remote server at a specific port.

on a pre-assumption this could be of help:

Code:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 1521 -j REDIRECT --to-ports [your_remote_server_ip]:1521
Quote:
But only opening port is not helping us connect to remote server. So we need to enalble nat for this specific port request. By what iptable command can we accomplish port based nating. Pl guide.
How did you opened the port ?
what have you tried till now ?
did you checked squid logs to confirm it is blocking your application?
did you checked application access logs to check whether it ever hit the remote server ?

It is Always advised to share proper content to get a proper answer.

Last edited by SAbhi; 10-03-2013 at 06:03 AM.
 
Old 10-08-2013, 03:58 AM   #5
shiladitya
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
When I tried to enable nating of port following error is comming
iptables v1.4.7: IP address not permitted.
checking the port is open or not by telnet the port.
 
  


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
string based nating using iptables. advaitraut Linux - Newbie 1 09-23-2009 01:28 PM
routing/nating based on http header mstjohn1974 Linux - Networking 3 03-02-2009 05:04 PM
Static Nating via iptables maliha Linux - Networking 5 01-09-2007 01:00 PM
iptables twice nating beno123 Linux - Networking 0 07-27-2005 02:41 AM
IPTables Undesired NATing Wraezor Linux - Security 3 07-15-2005 05:09 AM

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

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