From: Andrew Beverley <andy@andybev.com>
To: John Corps <envoys@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Redirecting DNS Not Working
Date: Fri, 15 Feb 2013 16:35:03 +0000 [thread overview]
Message-ID: <1360946103.2251.2.camel@andylaptop> (raw)
In-Reply-To: <CAFURDX-tc6+LgpcUhAeOE3i2=uh=bjjVaCHTGvZbO_Ty2+zV_A@mail.gmail.com>
On Fri, 2013-02-15 at 11:24 -0500, John Corps wrote:
> Hello All,
>
> I am having issues with redirecting DNS requests to the internal dns
> server. I have a very simple setup, if someone is put into vlan 1000
> then they do not get internet access at all. If they keep the DNS
> server assigned by DHCP, which is the IP of the gateway in vlan 1000,
> every request they make to a website is resolved to this IP and served
> up the webpage stating no internet is available. If they are clever
> enough to set there own DNS servers, when they open a browser, they do
> not get anything at all, just page can't be displayed. I have not done
> anything with iptables yet as the internal dns server is just
> resolving everything to the local IP address. What I want to do is if
> they set there own DNS, redirect them anyways back to the internal
> DNS. Here are the only 2 rules I have tried but they do not work at
> all, maybe i am missing something? Any help would be greatly
> appreciated!
>
> iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p tcp -m tcp --dport
> 53 -j REDIRECT --to-ports 53
> iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p udp -m udp --dport
> 53 -j REDIRECT --to-ports 53
If you want to redirect the requests to the local server, then you'll
need to use the DNAT target instead. All you're doing in your rules is
changing to port 53 a packet that is destined to port 53 (so nothing at
all).
Andy
next prev parent reply other threads:[~2013-02-15 16:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 16:24 Redirecting DNS Not Working John Corps
2013-02-15 16:35 ` Andrew Beverley [this message]
2013-02-15 16:56 ` John Corps
[not found] ` <CAFURDX-qor3-w4tVMt-aLfH2_tbNNz1KQwRHMA99MrzZL1UT9w@mail.gmail.com>
2013-02-15 17:05 ` Andrew Beverley
2013-02-15 17:28 ` John Corps
2013-02-15 18:13 ` Andrew Beverley
2013-02-15 18:46 ` John Corps
2013-02-15 19:15 ` Michael Ludvig
2013-02-15 19:19 ` John Corps
2013-02-16 11:35 ` Pascal Hambourg
2013-02-16 11:51 ` Andrew Beverley
2013-02-16 17:03 ` Pascal Hambourg
2013-02-15 18:04 ` /dev/rob0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360946103.2251.2.camel@andylaptop \
--to=andy@andybev.com \
--cc=envoys@gmail.com \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox