/ip dns
set allow-remote-requests=yes
/export hide-sensitive
It gets a better overall picture on what is going on.Why do you need my LAN config for a firewall problem?
/interface bridge
add admin-mac=******** auto-mac=no frame-types=admit-only-vlan-tagged ingress-filtering=yes name=bridge_lan vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] name=ether_01
set [ find default-name=ether2 ] name=ether_02
set [ find default-name=ether3 ] name=ether_03
set [ find default-name=ether4 ] name=ether_04
set [ find default-name=ether5 ] name=ether_05
set [ find default-name=ether6 ] name=ether_06
set [ find default-name=ether7 ] name=ether_07
set [ find default-name=ether8 ] name=ether_08
set [ find default-name=ether9 ] name=ether_09
set [ find default-name=ether10 ] name=ether_10
/interface vlan
add interface=bridge_lan name=vlan_50_management vlan-id=50
add interface=bridge_lan name=vlan_10 vlan-id=10
add interface=bridge_lan name=vlan_11 vlan-id=11
add interface=bridge_lan name=vlan_12 vlan-id=12
/interface ethernet switch port
set 0 default-vlan-id=0
set 1 default-vlan-id=0
set 2 default-vlan-id=0
set 3 default-vlan-id=0
set 4 default-vlan-id=0
set 5 default-vlan-id=0
set 6 default-vlan-id=0
set 7 default-vlan-id=0
set 8 default-vlan-id=0
set 9 default-vlan-id=0
set 10 default-vlan-id=0
set 11 default-vlan-id=0
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=dhcp_pool_vlan_50_management ranges=192.168.50.2-192.168.50.254
add name=dhcp_pool_vlan_10 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool_vlan_11 ranges=192.168.11.2-192.168.11.254
add name=dhcp_pool_vlan_12 ranges=192.168.12.2-192.168.12.254
/ip dhcp-server
add address-pool=dhcp_pool_vlan_50_management disabled=no interface=vlan_50_management name=dhcp_vlan_50_management
add address-pool=dhcp_pool_vlan_10 disabled=no interface=vlan_10 name=dhcp_vlan_10
add address-pool=dhcp_pool_vlan_11 disabled=no interface=vlan_11 name=dhcp_vlan_11
add address-pool=dhcp_pool_vlan_12 disabled=no interface=vlan_12 name=dhcp_vlan_12
/interface bridge port
add bridge=bridge_lan frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=yes interface=ether_02 pvid=50
add bridge=bridge_lan frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=yes interface=ether_03 pvid=10
add bridge=bridge_lan frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=yes interface=ether_04 pvid=11
add bridge=bridge_lan frame-types=admit-only-untagged-and-priority-tagged ingress-filtering=yes interface=ether_05 pvid=12
add bridge=bridge_lan comment=defconf disabled=yes interface=ether_06
add bridge=bridge_lan comment=defconf disabled=yes interface=ether_07
add bridge=bridge_lan comment=defconf disabled=yes interface=ether_08
add bridge=bridge_lan comment=defconf disabled=yes interface=ether_09
add bridge=bridge_lan disabled=yes interface=ether_10
/ip neighbor discovery-settings
set discover-interface-list=none
/interface bridge vlan
add bridge=bridge_lan tagged=bridge_lan untagged=ether_02 vlan-ids=50
add bridge=bridge_lan tagged=bridge_lan untagged=ether_03 vlan-ids=10
add bridge=bridge_lan tagged=bridge_lan untagged=ether_04 vlan-ids=11
add bridge=bridge_lan tagged=bridge_lan untagged=ether_05 vlan-ids=12
/interface list member
add comment="WAN interface" interface=ether_01 list=WAN
add interface=vlan_50_management list=LAN
add interface=vlan_10 list=LAN
add interface=vlan_11 list=LAN
add interface=vlan_12 list=LAN
add interface=bridge_lan list=LAN
/ip address
add address=192.168.50.1/24 interface=vlan_50_management network=192.168.50.0
add address=192.168.10.1/24 interface=vlan_10 network=192.168.10.0
add address=192.168.11.1/24 interface=vlan_11 network=192.168.11.0
add address=192.168.12.1/24 interface=vlan_12 network=192.168.12.0
/ip cloud
set update-time=no
/ip dhcp-client
add disabled=no interface=ether_01 use-peer-dns=no
/ip dhcp-server network
add address=192.168.50.0/24 gateway=192.168.50.1 netmask=24
add address=192.168.10.0/24 gateway=192.168.10.1 netmask=24
add address=192.168.11.0/24 gateway=192.168.11.1 netmask=24
add address=192.168.12.0/24 gateway=192.168.12.1 netmask=24
/ip dns
set servers=1.1.1.1
/ip firewall filter
add action=drop chain=input dst-port=53 in-interface-list=WAN log=yes protocol=tcp
add action=drop chain=forward dst-port=53 in-interface-list=WAN protocol=tcp
add action=drop chain=input dst-port=53 in-interface-list=WAN protocol=udp
add action=drop chain=forward dst-port=53 in-interface-list=WAN protocol=udp
add action=accept chain=input connection-state=established,related
add action=drop chain=input connection-state=invalid
add action=accept chain=input protocol=icmp
add action=accept chain=input dst-address=127.0.0.1
add action=drop chain=input in-interface-list=!LAN log=yes
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set udplite disabled=yes
set dccp disabled=yes
set sctp disabled=yes
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set www-ssl address=************************ certificate=******************* disabled=no tls-version=only-1.2
set api disabled=yes
set winbox address=****************************************************************
set api-ssl disabled=yes
/ip ssh
set strong-crypto=yes
/system clock
set time-zone-name=*****************************
/system console
add disabled=no port=serial1
/system identity
set name=*****************************
/system ntp client
set enabled=yes server-dns-names=pool.ntp.org
/system package update
set channel=long-term
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool mac-server ping
set enabled=no
No, the counters are freeze.Configuration looks OK. Normally you should not need to block port 53 on outside, nor should it be open by it self.
I have no linux server outside, so can not test my port.
Do you see any count increase on your firewall rule when you test port 53?
https://pentest-tools.com/network-vulne ... nline-nmapConfiguration looks OK. Normally you should not need to block port 53 on outside, nor should it be open by it self.
I have no linux server outside, so can not test my port.
It is not helpful. If you scan with classic nmap query "sudo nmap -sV -p 53 <IP>"https://pentest-tools.com/network-vulne ... nline-nmapConfiguration looks OK. Normally you should not need to block port 53 on outside, nor should it be open by it self.
I have no linux server outside, so can not test my port.
Just try a free scan ? It will test 53 also in the "free" edition
In my case I have 0 ports open so that's good.
So from this test it looks up, but DNS does not resolve anything.nmap -sS -sU -sV -Pn -p 53 92.220.xx.yy
Starting Nmap 7.80 ( https://nmap.org ) at 2021-04-02 20:43 CEST
Nmap scan report for x.y.z(92.220.xx.yy)
Host is up.
PORT STATE SERVICE VERSION
53/tcp filtered domain
53/udp open|filtered domain
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 104.45 seconds
nslookup
> server 92.220.xx.yy
Default server: 92.220.xx.yy
Address: 92.220.xx.yy#53
> google.com
;; connection timed out; no servers could be reached
>
/ip firewall filter
add action=log chain=input protocol=tcp
add action=log chain=input protocol=udp
I tried also
nc -w5 -z -v <MyIP> 53
and
Connection to <MyIP> 53 port [tcp/domain] succeeded!
I dont know what to say....
How my ISP can make a port in my router to respond to requests?
Should i netinstall clean firmware?
And how can i do it?
Very hard to believe the packet-capture (very low level) would "miss out" on your nmap packets which are supposed to come in.i have used Packet sniffer inside routerOS.
Filters: ether 01, tcp 53, direction any, filter operation AND.
When sudo nmap -sS -Pn <IP> packets are visible, firewall is working and packets blocked. Nmap says all ports are filtered.
When sudo nmap -sS -Pn -p 53 <IP> packets not coming, and obviously firewall do nothing. But Nmap says port is open.
So the real question is:
Is it a bug of nmap OR is it a method of evading the packet discovery and eventually the firewall?
Any ideas to differentiate between the 2?
¨This is why users should use DoH / DNSCrypt / etc to prevent this kind of abuse from ISPs.
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=!X.X.X.X dst-port=53 in-interface-list=!WAN log=yes log-prefix=NAT-DNS-TO-X.X.X.X protocol=tcp to-addresses=X.X.X.X to-ports=53
add action=dst-nat chain=dstnat dst-address=!X.X.X.X dst-port=53 in-interface-list=!WAN log=yes log-prefix=NAT-DNS-TO-X.X.X.X protocol=udp to-addresses=X.X.X.X to-ports=53
Thanks so much for this. This was driving me crazy.I want to add more data to this post for if someone else happens to run across this issue themselves as well. I was experiencing the exact same issue as the OP was describing, nmap was showing port 53 as being open. In my case, the router was also responding to DNS requests. I have all the same firewall rules placed in the same location and order as well as the allow-remote-requests set to no under "/ip dns".
However, what I'm doing that is not the same as the OP is dst-nat'ing all dns queries to my own internal DNS server to combat devices that do not adhere to the DHCP settings that are given out and attempt to use their own settings instead.
The resolution for my problem was to add "in-interface-list=!WAN" to both of these nat rules, which prevents it from accepting any DNS queries on the WAN interface, as well as showing as open with nmap.
Code: Select all/ip firewall nat add action=dst-nat chain=dstnat dst-address=!X.X.X.X dst-port=53 in-interface-list=!WAN log=yes log-prefix=NAT-DNS-TO-X.X.X.X protocol=tcp to-addresses=X.X.X.X to-ports=53 add action=dst-nat chain=dstnat dst-address=!X.X.X.X dst-port=53 in-interface-list=!WAN log=yes log-prefix=NAT-DNS-TO-X.X.X.X protocol=udp to-addresses=X.X.X.X to-ports=53