View previous topic :: View next topic |
Author |
Message |
yakapiece Tux's lil' helper
Joined: 03 Feb 2004 Posts: 126 Location: Atlanta, GA
|
Posted: Mon Dec 06, 2004 4:49 am Post subject: iptables: redirect DNS |
|
|
I've search forums and the howto on LDP but what am I doing wrong?
Code: |
iptables -t nat -A PREROUTING -p udp --dport 53
-j DNAT --to-destination xxx.xxx.xxx.xxx:xx
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to xxx.xxx.xxx.xxx:xx
|
The first is successful, but the second I get
iptables: Invalid argument
I'm looking to redirect the dns from behind my firewall, I've seen a few examples like the above. |
|
Back to top |
|
|
mayday147 l33t
Joined: 22 Mar 2004 Posts: 825 Location: Bucharest, Romania
|
Posted: Mon Dec 06, 2004 5:50 am Post subject: |
|
|
The 'OUTPUT' chain is not a part of the 'nat' table , so try this:
Code: | iptables -A OUTPUT -p udp --dport 53 -j DNAT --to xxx.xxx.xxx.xxx:xx |
_________________ gentoo.ro |
|
Back to top |
|
|
yakapiece Tux's lil' helper
Joined: 03 Feb 2004 Posts: 126 Location: Atlanta, GA
|
Posted: Mon Dec 06, 2004 5:19 pm Post subject: |
|
|
thank you for your response, but I get the same error
iptables: Invalid argument
Any other suggestions? |
|
Back to top |
|
|
JohnDoe Tux's lil' helper
Joined: 15 Dec 2003 Posts: 96 Location: Lisbon, Portugal
|
Posted: Tue Dec 21, 2004 10:31 pm Post subject: |
|
|
yakapiece wrote: | thank you for your response, but I get the same error
iptables: Invalid argument
Any other suggestions? |
If I'm not mistaken, the problem now is with -j DNAT since in the filter table (the default one) there isn't a -j argument (at least coupled with DNAT) can't be used. But I'm just guessing, haven't been around iptables for a while... |
|
Back to top |
|
|
|