LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-28-2012, 01:05 AM   #1
Tekiano
LQ Newbie
 
Registered: Nov 2012
Posts: 12

Rep: Reputation: Disabled
Can't add a Port address translation rule


Hi All,

I try since two days to redirect traffic coming in a port to another address and port, the problem is that iptables returns me :
Code:
iptables: No chain/target/match by that name.
I use linux kernel 2.6.39
iptables version iptables v1.4.12

here the rules
Code:
iptables -v -t nat -D PREROUTING -p tcp --dport 80 -j DNAT --to-dest
ination 192.168.0.3:81 
DNAT  tcp opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0   tcp dpt:80 to:192.168.0.3:81
iptables: No chain/target/match by that name.
Does any one Know which option I have to activate in the kernel to resolve this ?

Thank you

Last edited by Tekiano; 11-28-2012 at 01:11 AM.
 
Old 11-28-2012, 04:00 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Option "-D" means to delete specific rule, you want to use option "-I PREROUTING" or "-A PREROUTING" to add new rule. Remember also to enable forwarding on this machine, by for example:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward

Last edited by eSelix; 11-28-2012 at 04:05 AM.
 
1 members found this post helpful.
Old 11-28-2012, 04:43 AM   #3
Tekiano
LQ Newbie
 
Registered: Nov 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thank you eSelix, this fixes my problem.
 
  


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
Iptables can't port forward (PAT Port address translation) sfrederiksen Linux - Networking 7 12-20-2011 10:47 AM
IPTABLES PORT TRANSLATION / REDIRECT to a different address daveginorge Linux - Newbie 2 05-07-2010 01:59 PM
Need help implementing Port Address Translation with iptables Ashmatash Linux - Networking 4 02-04-2010 10:11 PM
Test if port address translation is working dales79 Linux - Security 1 01-17-2006 07:01 AM

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

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