Community discussions

MikroTik App
 
littlebill
Member Candidate
Member Candidate
Topic Author
Posts: 234
Joined: Sat Apr 30, 2011 3:11 am

DNS redirect

Thu Jun 07, 2012 4:25 am

I don't understand this rule
In /ip firewall filter nat

add chain=dstnat action=dst-nat to-addresses=192.168.88.1 to-ports=53 protocol=tcp dst-port=53 

add chain=dstnat action=dst-nat to-addresses=192.168.88.1 to-ports=53 protocol=udp dst-port=53 

why is this not a src-nat, or a forward rule? the request goes from the client to the server back

my understanding is the request goes out the standard dns server, whatever is set, but on reply is when it get modified and sent to another dns server with the reply, how does the original client even get the request?


i don't understand how this rule works at all. any help??? i don't like blindly installing rules i don't understand

i always used dstnat to do port forwarding. i don't understand at all
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: DNS redirect

Thu Jun 07, 2012 4:35 am

dst-nat is used for redirect the traffic for an other ip, in this case is used for redirect the request dns for an other server dns

port forwarding is a redirect of the traffic for a internal ip adress.
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: DNS redirect

Thu Jun 07, 2012 4:43 am

These two rules (one for TCP and one for UDP) are redirecting any traffic to port 53 to port 53 at 192.168.88.1 which is presumably the DNS service on the routeros system.
 
littlebill
Member Candidate
Member Candidate
Topic Author
Posts: 234
Joined: Sat Apr 30, 2011 3:11 am

Re: DNS redirect

Thu Jun 07, 2012 4:45 am

I need a more technical answer. I understand how dst Nat works. I don't understand the traffic flow at all, port forward redirects to another server on an in coming request

This rules seems to do the same. I'm sorry I need. A better answer
 
littlebill
Member Candidate
Member Candidate
Topic Author
Posts: 234
Joined: Sat Apr 30, 2011 3:11 am

Re: DNS redirect

Thu Jun 07, 2012 4:47 am

These two rules (one for TCP and one for UDP) are redirecting any traffic to port 53 to port 53 at 192.168.88.1 which is presumably the DNS service on the routeros system.


I get that it is redirecting, but how the hell is the client getting a reply from the dns server. I could understand if it was a forward which pointed the request to a different server. But we are not doing that
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: DNS redirect

Thu Jun 07, 2012 5:07 am

The client gets a reply via the opened connection - it is just that 192.168.88.1 is servicing it.
 
bitsmt
just joined
Posts: 10
Joined: Tue Jun 05, 2012 9:04 pm

Re: DNS redirect

Thu Jun 07, 2012 5:19 am

I don't understand this rule
In /ip firewall filter nat

add chain=dstnat action=dst-nat to-addresses=192.168.88.1 to-ports=53 protocol=tcp dst-port=53 
add chain=dstnat action=dst-nat to-addresses=192.168.88.1 to-ports=53 protocol=udp dst-port=53 
Is this what happens when you select the option to allow DNS access from the outside world? I've seen an option when using Winbox (it is a check box).
 
tjc
Member Candidate
Member Candidate
Posts: 276
Joined: Sun Jul 10, 2011 3:08 am

Re: DNS redirect

Sat Jun 09, 2012 7:29 pm

Those rules force all DNS requests to use the routers DNS server.

The rules read: for any any specified destination address with destination port 53 (DNS) either TCP or UDP redirect the request to 192.168.88.1 port 53 (DNS)

Since 192.168.88.1 is the routers default internal LAN address (vs. the external one it gets from the upstream feed via DHCP or static config) this is probably just intended for requests from the LAN side.
 
Devil
Member Candidate
Member Candidate
Posts: 170
Joined: Thu Jul 21, 2011 9:13 am

Re: DNS redirect

Sun Jun 10, 2012 11:45 am

I need a more technical answer. I understand how dst Nat works. I don't understand the traffic flow at all, port forward redirects to another server on an in coming request

This rules seems to do the same. I'm sorry I need. A better answer
You just answered your own question. you need to take a look at Packet Flow . in short, destination nat, is being applied before routing decision. routing facility or firewall, get the packets after destination nat has been applied. as far as they concern, they are getting the original packets. so they act accordingly.

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot], voytecky and 107 guests