Community discussions

MikroTik App
 
User avatar
antefe
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Fri Oct 12, 2007 12:36 pm
Location: Crete-Greece

Weird DNS problem...

Tue Aug 08, 2023 8:19 am

Hello everyone, I've been trying to route traffic through 2 LTE interfaces so I followed a guide online and created the following Address Lists
add address=10.0.0.0/16 list=PrivateIPAddresses
add address=192.168.0.0/16 list=PrivateIPAddresses
add address=172.16.0.0/12 list=PrivateIPAddresses

and the following mangle rules

/ip firewall mangle
add action=mark-routing chain=prerouting dst-address-list=!PrivateIPAddresses \
in-interface=bridge new-routing-mark=lte1.fake passthrough=no
add action=mark-routing chain=prerouting dst-address-list=!PrivateIPAddresses \
in-interface=bridgeClients new-routing-mark=lte1.real passthrough=no

The weird thing is that I couldn't get the lte1.fake to work... I could ping but the DNS didn't work at all...
What I found out, is that I made a "typo" on one of the address lists, what I wrote was:
add address=192.168.0.0.16 list=PrivateIPAddresses

Can someone please explain to me what I wrote, I mean what is 192.168.0.0.16?????? Should routeros stop me from writing something foolish like that, or is it something that I'm just not aware of?? (my quess is the second!!!)
Thanks in advance :)
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3536
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Weird DNS problem...

Tue Aug 08, 2023 8:47 am

Yeah that odd... But what's going on is 192.168.0.0.16 becomes a string, so address-list thinks it's DNS lookup. And DNS lookups in address-list are valid, so it allows you to add with what you think is an invalid address= but to RouterOS is a DNS query for "192.168.0.0.16"
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2886
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: Weird DNS problem...

Tue Aug 08, 2023 11:09 am

...I mean what is 192.168.0.0.16??????...
IMHO it means: server named "192" in the "168.0" subdomain of "0.16" domain.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10266
Joined: Mon Jun 08, 2015 12:09 pm

Re: Weird DNS problem...

Tue Aug 08, 2023 11:46 am

Yes, that is how it is handled. A bit more prudent would be to require at least one letter in the name before it is handled as DNS lookup.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3536
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Weird DNS problem...

Tue Aug 08, 2023 3:16 pm

Yes, that is how it is handled. A bit more prudent would be to require at least one letter in the name before it is handled as DNS lookup.
True, the number be valid (e.g. in-addr.arpa), so it just the top-level that isn't checked... But...then again it matches /ip/dns/static logic: that's allows defining an all number domainname in an A record (name=192.168.0.0.24).

Even more prudent...be have some "status" to know the DNS lookup failed. e.g. using "bad.gooogle.coom" also doesn't show any error – but I've run into fat fingering a domain name myself before – only visual clue is address-list doesn't populate any dynamic entries...
 
User avatar
Znevna
Forum Guru
Forum Guru
Posts: 1348
Joined: Mon Sep 23, 2019 1:04 pm

Re: Weird DNS problem...

Tue Aug 08, 2023 4:03 pm

[...]
What I found out, is that I made a "typo" on one of the address lists
[...]
is it something that I'm just not aware of?? (my quess is the second!!!)
Thanks in advance :)
You seem to do that a lot. :-?
 
User avatar
antefe
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Fri Oct 12, 2007 12:36 pm
Location: Crete-Greece

Re: Weird DNS problem...

Tue Aug 08, 2023 6:47 pm

Thanks for all the replies, as always, I am wiser thanks to you!

Who is online

Users browsing this forum: Bing [Bot] and 31 guests