Community discussions

MikroTik App
 
jamthejame
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Mon Jan 15, 2018 12:12 pm

Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Thu May 03, 2018 5:38 pm

Past two weeks have been going back and forth with support to resolve the issue of DNS (so far nothing solved), here is the issue:
1. DNS works on default settings
2. Adding L2TP/IPSEC layer, DNS only seems to work by using Tools>Traceroute and able to ping
3. Parallel, from Windows (or Linux), no ping and not DNS resolution
4. Tools>Torch on LAN interface shows requests to DNS IPs are being sent, but nothing gets returned
5. Tools>Torch on VPN interface shows requests to DNS IPs are bieng sent and returned
6. Seems as Mikrotik is not passing DNS to LANs
[admin@MikroTik] > export
# may/03/2018 10:15:43 by RouterOS 6.41
# software id = YC2G-EAPK
#
# model = RouterBOARD 3011UiAS
# serial number = 8EEE087D08F1
/interface bridge
add admin-mac=CC:2D:E0:B7:F2:B5 auto-mac=no comment=defconf name=bridge
/interface l2tp-client
add add-default-route=yes allow-fast-path=yes connect-to=******\
    dial-on-demand=yes disabled=no ipsec-secret=******* keepalive-timeout=\
    10 max-mru=1410 max-mtu=1410 name=VPN password=****** use-ipsec=\
    yes user=*******
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=ether6
add bridge=bridge comment=defconf interface=ether7
add bridge=bridge comment=defconf interface=ether8
add bridge=bridge comment=defconf interface=ether9
add bridge=bridge comment=defconf interface=sfp1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
    192.168.88.0
/ip dhcp-client
add add-default-route=no comment=defconf dhcp-options=hostname,clientid \
    disabled=no interface=ether1 use-peer-dns=no use-peer-ntp=no
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set servers=10.10.10.10,8.8.8.8
/ip dns static
add address=192.168.88.1 name=router.lan
add address=10.10.10.10 name=DNS
add address=8.8.8.8 name=google
/ip firewall filter
add action=accept chain=input comment="Allow ICMP" protocol=icmp
add action=accept chain=input dst-port=53 protocol=tcp
add action=accept chain=input dst-port=53 protocol=udp
add action=accept chain=output dst-port=53 protocol=udp
add action=accept chain=output dst-port=53 protocol=tcp
/ip firewall mangle
add action=mark-routing chain=prerouting log=yes new-routing-mark=VPN \
    passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=VPN
add action=masquerade chain=srcnat disabled=yes out-interface=ether1 \
    src-address-list=""
/ip route
add distance=1 gateway=VPN routing-mark=VPN
add distance=2 gateway=192.168.1.1
/system clock
set time-zone-name=America/New_York
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Now, here is a short list of troubleshooting that was already done:
1. Changed L2TP/IPSEC servers / Used the ones that other machines are working on with no problem to eliminate possibility of L2TP/IPSEC server issue
2. Used same DNS as on other machines that are presently working (10.10.10.10 - if private DNS)
3. Present active machines work without "Allow Remote Requests", tried with/without, still issues
4. Downgraded from 6.42 to 6.41 as most machines are on 6.41 working fine. Downgrade didnt change anything
5. Added rules strictly for DNS, no change
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Thu May 03, 2018 5:48 pm

I don't see any DNS settings in DHCP Server for your clients

"/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1"


How is DNS configured on clients?
 
jamthejame
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Mon Jan 15, 2018 12:12 pm

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Thu May 03, 2018 6:58 pm

Mikrotik: Tried setting DNS on each network, no change

Client: set Windows on automatic for DNS and DHCP; also I tried static for both, no change
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Thu May 03, 2018 9:48 pm

Maybe netinstall the device to get a clean install and config?
 
User avatar
jspool
Member
Member
Posts: 472
Joined: Sun Oct 04, 2009 4:06 am
Location: Oregon

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Thu May 03, 2018 10:58 pm

Are both sides using the same RouterOS version? I recently had a problem with l2tp between 6.40.8 and 6.42.1. Once I updated both to 6.42.1 it worked. Not sure if it has any bearing in your case.
 
jamthejame
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Mon Jan 15, 2018 12:12 pm

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Thu May 03, 2018 11:29 pm

I had a weird phenomena with upgrade.

They system came with 6.41.3, so I upgraded it to 6.42. After upgrade, it worked well, but after reboot, i lost DNS Mik to client again. I did the same thing again, downgrade and then upgraded and same happened.

You mentioned that you had similar issue, and 6.42 resolved it all?... I'm running RB3011 here with ARM chipset, was yours the same?

Regarding Netinstall. I tried doing it, but have a hard time getting it done.
 
User avatar
sindy
Forum Guru
Forum Guru
Posts: 11362
Joined: Mon Dec 04, 2017 9:19 pm

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes  [SOLVED]

Thu May 03, 2018 11:49 pm

1. You mark all packets with routing mark "VPN" in chain=prerouting of /ip firewall mangle. This means that all forward and input packets (i.e. all those which are not sent by Mikrotik itself) get marked. This includes response packets from the DNS on 10.10.10.10 or 8.8.8.8, regardless via which interface they got to the router.

2. The only route in routing table "VPN" is the default one.

The point which is easy to miss is that once a packet is marked with a routing mark, it uses the routing table corresponding to that mark for all destinations, including those on local subnets. The only exception is when no route in the marked routing table matches the packet destination; in this case, the default routing table "main" is used as a backup. But that is not the case here, because the response packets from the DNS, with IP addresses of LAN clients as destinations, match the default route of table VPN, and consequently are sent back to the VPN gateway, and circulate several times until their TTL decreases to 0.

Another frequent misconception is the role of the distance parameter of /ip route. It only plays a role when both the routing-mark and dst-address parameters are exactly the same for two routes. In other cases, a route with longer (narrower) prefix in dst-adddress always wins over a route with a shorter (wider) one, and the routing-mark match wins over prefix length.

So the fix should be the following:
  • create a route with dst-address set to the VPN server to which you connect and the same gateway like your current route with distance=2. A route with more precisely matching destination always wins over a route with wider match, so even if the default route through the VPN becomes active once the VPN goes up, this individual route will remain available for VPN's transport packets
  • remove the routing mark from your current route with distance=1 and routing-mark=VPN
  • remove the mangle rule marking traffic with routing-mark VPN
 
jamthejame
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Mon Jan 15, 2018 12:12 pm

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Fri May 04, 2018 12:23 am

Thank you much. It worked.
 
User avatar
sindy
Forum Guru
Forum Guru
Posts: 11362
Joined: Mon Dec 04, 2017 9:19 pm

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Fri May 04, 2018 12:51 pm

Good. Now please have a look at this supercharged introduction to Mikrotik firewall and fix your firewall rules. They indicate some intention which is however not fulfilled.
 
jamthejame
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Mon Jan 15, 2018 12:12 pm

Re: Exhaustive Trouble Shooting of no DNS via L2TP/IPSEC, NEW IDEAS welcomes

Sat May 05, 2018 3:30 am

Thank you, Sindy.