Community discussions

MikroTik App
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 337
Joined: Tue Dec 21, 2021 5:12 am

Split DNS in Mikrotik to override a delay problem

Wed Apr 26, 2023 7:35 pm

Hello for all..!
so i have a RB951 and i am trying to apply hairpin nat to see my duhua nvr that have the ip address 192.168.1.122 and port 38888 from inside my local network, i apply the rule below as you will see and it works..! but there is a huge delay in the video stream from nvr.
from outside using public ip there is no dealy.
also from inside using local ip also there is no delay.
but when i open it from inside using the public ip here is the problem happen -alot of delay-
anyone have any idea about how i can get rid of this problem..?
after a lot of rsearch i come with this Split DNS thing that i have to apply to avoid this problem..! well but actually i don't know what this split DNS in the first Place, so anyone
can give an advise or explaination about how can i config this split DNS in my router..?

here is my NAT config
/ip firewall nat
add action=masquerade chain=srcnat disabled=yes dst-address=192.168.2.2 \
out-interface=Bridge protocol=tcp src-address=192.168.1.0/24 \
to-addresses=192.168.2.2
add action=masquerade chain=srcnat dst-address=192.168.1.122 dst-port=38888 \
out-interface=Bridge protocol=tcp src-address=192.168.1.0/24 \
to-addresses=192.168.2.2
add action=dst-nat chain=dstnat dst-address=192.168.2.2 dst-port=38888 \
protocol=tcp to-addresses=192.168.1.122 to-ports=38888

also here is my router config ..
You do not have the required permissions to view the files attached to this post.
 
User avatar
Ca6ko
Member
Member
Posts: 498
Joined: Wed May 04, 2022 10:59 pm
Location: Kharkiv, Ukraine

Re: Split DNS in Mikrotik to override a delay problem

Thu Apr 27, 2023 4:38 pm

For the Dahua NVR it is better to use the connection by serial number. Enable P2P in the settings. Create a new connection in the program, select connection by QR code or S/N. Scan the code or enter the number manually and everything will work.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 337
Joined: Tue Dec 21, 2021 5:12 am

Re: Split DNS in Mikrotik to override a delay problem

Thu Apr 27, 2023 8:12 pm

For the Dahua NVR it is better to use the connection by serial number. Enable P2P in the settings. Create a new connection in the program, select connection by QR code or S/N. Scan the code or enter the number manually and everything will work.
well i know this steps.. yet my customer have a public IP and he want to use it. so better view that QR code.
 
User avatar
Ca6ko
Member
Member
Posts: 498
Joined: Wed May 04, 2022 10:59 pm
Location: Kharkiv, Ukraine

Re: Split DNS in Mikrotik to override a delay problem

Fri Apr 28, 2023 10:40 am

If you use the serial number connection, the double NAT connection will still be established and everything will work.
You don't have a public address on the mikrotik so it has nothing to do with it. You have an Asus for Hairpin NAT.
For mikrotik you have to turn on the standard NAT and disable unnecessary rules.

/ip firewall nat
add action=masquerade chain=srcnat dst-address=192.168.1.122 dst-port=38888 out-interface=Bridge protocol=tcp src-address=192.168.1.0/24 to-addresses=192.168.2.2
add action=dst-nat chain=dstnat dst-address=192.168.2.2 dst-port=38888 protocol=tcp to-addresses=192.168.1.122 to-ports=38888
add action=src-nat chain=srcnat comment="defconf: masquerade" out-interface-list=WAN to-addresses=192.168.2.2

PS You do not use DNS when you connect to an IP address.
Next time you ask such questions, draw a network diagram.

Who is online

Users browsing this forum: diasdm and 32 guests