Community discussions

MikroTik App
 
User avatar
digin4
just joined
Topic Author
Posts: 13
Joined: Tue Jan 22, 2019 8:18 pm

weird behavior using Netwatch commands & scripts

Mon Jan 27, 2020 5:15 pm

If I modify my script to disable more than 4 NAT rules it stops working and says "no such item (4)"

This is what works:

/ip firewall nat disable 1,2,3,4
/ip dns set servers=9.9.9.11,149.112.112.11
/tool e-mail send to="address@gmail.com" subject="Pi-hole is down on $[/system clock get time]."

If I use /ip firewall nat disable 1,2,3,4,5,6 it stops working and gives the error, even though I have 7 NAT rules, the command works from terminal.
 
User avatar
skylark
Member Candidate
Member Candidate
Posts: 144
Joined: Wed Feb 10, 2016 3:55 pm

Re: weird behavior using Netwatch commands & scripts  [SOLVED]

Wed Jan 29, 2020 7:43 am

 
User avatar
inteq
Member
Member
Posts: 406
Joined: Wed Feb 25, 2015 8:15 pm
Location: Romania

Re: weird behavior using Netwatch commands & scripts

Sun Feb 02, 2020 3:58 pm

Try another way of using your pi-hole. No need to disable the NAT rule

viewtopic.php?f=2&t=149968&p=738612#p738526
 
User avatar
digin4
just joined
Topic Author
Posts: 13
Joined: Tue Jan 22, 2019 8:18 pm

Re: weird behavior using Netwatch commands & scripts

Sun Feb 02, 2020 4:29 pm

I use unbound on my Pihole, and only these NAT rules works when there's a hard coded DNS on a client:
/ip firewall nat add chain=dstnat action=accept src-address=192.168.1.250
/ip firewall nat add action=dst-nat chain=dstnat dst-port=53 in-interface=bridge protocol=tcp to-addresses=192.168.1.1
/ip firewall nat add action=dst-nat chain=dstnat dst-port=53 in-interface=bridge protocol=udp to-addresses=192.168.1.1
But you are right, I don't have to disable NAT rules when my Pihole goes down, thanks!

Who is online

Users browsing this forum: Google [Bot], Jotne and 28 guests