Community discussions

MikroTik App
 
andersenbrittany
just joined
Topic Author
Posts: 1
Joined: Sun Jan 27, 2019 4:38 pm

Looking for a mikrotik router Model that supports DNAT

Sun Jan 27, 2019 6:07 pm

Hi everyone..

Looking for a mikrotik router Model that supports DNAT. After all the posts about devices ignoring pihole and people using DNAT to force the usage of pihole, I've been looking into it a little bit.

But it seems that I can only find results (google) about Ubiquiti devices and DNAT. I've looked at the price of a WiFi router (€149) and it's a bit too much for me. My budget is <= €100. Cheaper Ubiquity options are just switches, but I need a WiFi router to replace the one given to me by my ISP (which will be in bridge mode).
 
gotsprings
Forum Guru
Forum Guru
Posts: 2122
Joined: Mon May 14, 2012 9:30 pm

Re: Looking for a mikrotik router Model that supports DNAT

Mon Jan 28, 2019 3:23 pm

pihole is a local dns server right?

You would set the dhcp-server to handout the pihole address to clients.

Then set up a rule to capture anything on port 53 and send it to your pihole server.

Any Tik should be able to do this.
Last edited by gotsprings on Mon Jan 28, 2019 3:31 pm, edited 1 time in total.
 
User avatar
AlainCasault
Trainer
Trainer
Posts: 632
Joined: Fri Apr 30, 2010 3:25 pm
Location: Prévost, QC, Canada
Contact:

Re: Looking for a mikrotik router Model that supports DNAT

Mon Jan 28, 2019 3:27 pm

Hello

All MikroTik devices support dnat.

Cheers

Sent from my cell phone. Sorry for the errors.

 
zandhaas
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Tue Dec 11, 2018 11:02 pm
Location: The Netherlands

Re: Looking for a mikrotik router Model that supports DNAT

Mon Jan 28, 2019 4:52 pm

I'm using DHCP-Server option 6 to forward all DHCP clients DNS to the PI-Hole server.

/ip dhcp-server option print
# NAME CODE VALUE RAW-VALUE
0 PIHole 6 '192.168.x.x' c0a80032

Where 192.168.x.x is the PI-Hole address.
 
gotsprings
Forum Guru
Forum Guru
Posts: 2122
Joined: Mon May 14, 2012 9:30 pm

Re: Looking for a mikrotik router Model that supports DNAT

Mon Jan 28, 2019 7:16 pm

I'm using DHCP-Server option 6 to forward all DHCP clients DNS to the PI-Hole server.

/ip dhcp-server option print
# NAME CODE VALUE RAW-VALUE
0 PIHole 6 '192.168.x.x' c0a80032

Where 192.168.x.x is the PI-Hole address.
Would be even easier to put it in
/ip dhcp-server network
add address=192.168.2.0/24 comment="Typical /24" dns-server=192.168.2.1 \
    gateway=192.168.2.1
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Looking for a mikrotik router Model that supports DNAT

Tue Jan 29, 2019 8:45 am

I do not use DNAT or pi-hole.
Just add DNS localy to my public webserver for user on the net and user on the outside gets the public IP and will going trough nat to the web server.
 
zandhaas
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Tue Dec 11, 2018 11:02 pm
Location: The Netherlands

Re: Looking for a mikrotik router Model that supports DNAT

Tue Jan 29, 2019 8:54 am

I'm using DHCP-Server option 6 to forward all DHCP clients DNS to the PI-Hole server.

/ip dhcp-server option print
# NAME CODE VALUE RAW-VALUE
0 PIHole 6 '192.168.x.x' c0a80032

Where 192.168.x.x is the PI-Hole address.
Would be even easier to put it in
/ip dhcp-server network
add address=192.168.2.0/24 comment="Typical /24" dns-server=192.168.2.1 \
    gateway=192.168.2.1


The advantage of using the DHCP option 6 method is that all clients get the PI-Hole server as DNS server. So in PI-Hole you can see the real client requests instead off the router sending all request.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11627
Joined: Thu Mar 03, 2016 10:23 pm

Re: Looking for a mikrotik router Model that supports DNAT

Tue Jan 29, 2019 2:44 pm

Would be even easier to put it in
/ip dhcp-server network
add address=192.168.2.0/24 comment="Typical /24" dns-server=192.168.2.1 \
    gateway=192.168.2.1


The advantage of using the DHCP option 6 method is that all clients get the PI-Hole server as DNS server. So in PI-Hole you can see the real client requests instead off the router sending all request.
The line by @gotsprings should rather read as
/ip dhcp-server network
add address=192.168.2.0/24 dns-server=192.168.x.x gateway=192.168.2.1

Where 192.168.x.x is the PI-Hole address. The above should direct all DHCP clients to use PI-Hole as DNS server and is actually human-readable version of your construct.
You still have to redirect any connections to external DNS servers if you want to force all clients to use PI-Hole (also those who statically configure their IP settings).
 
gotsprings
Forum Guru
Forum Guru
Posts: 2122
Joined: Mon May 14, 2012 9:30 pm

Re: Looking for a mikrotik router Model that supports DNAT

Wed Jan 30, 2019 9:58 pm

Something like
/ip firewall nat
add action=dst-nat chain=dstnat comment="Redirect Guest DNS" dst-address=!192.168.x.x \
    dst-port=53 protocol=udp src-address-list=Local to-addresses=192.168.x.x
and mkv was correct. have the dhcp server tell the clients to use your piehole...
(Kind of sounds rude when I type it like that...)

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 79 guests