Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables: redirect DNS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
yakapiece
Tux's lil' helper
Tux's lil' helper


Joined: 03 Feb 2004
Posts: 126
Location: Atlanta, GA

PostPosted: Mon Dec 06, 2004 4:49 am    Post subject: iptables: redirect DNS Reply with quote

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
View user's profile Send private message
mayday147
l33t
l33t


Joined: 22 Mar 2004
Posts: 825
Location: Bucharest, Romania

PostPosted: Mon Dec 06, 2004 5:50 am    Post subject: Reply with quote

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
View user's profile Send private message
yakapiece
Tux's lil' helper
Tux's lil' helper


Joined: 03 Feb 2004
Posts: 126
Location: Atlanta, GA

PostPosted: Mon Dec 06, 2004 5:19 pm    Post subject: Reply with quote

thank you for your response, but I get the same error
iptables: Invalid argument

Any other suggestions?
Back to top
View user's profile Send private message
JohnDoe
Tux's lil' helper
Tux's lil' helper


Joined: 15 Dec 2003
Posts: 96
Location: Lisbon, Portugal

PostPosted: Tue Dec 21, 2004 10:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum