In a Mikrotik RB750Gr3 I have the NordVpn VPN serving a segment of my internal network. To access the other segments of my internal network, I defined NAT rules in the Firewall. The problem is that the VPN randomly restarts and its NAT rule goes to position 0, the addresses of my internal networks are no longer reached because they are forwarded to the NAT VPN. I need to put the VPN NAT rule after my internal network NAT rules, the Chat GPT get script doesn't work, any suggestions?
:local firstRuleId [/ip firewall nat find limit=1]
:local comment [/ip firewall nat get $firstRuleId comment]
:if ($comment = "ipsec mode-config") do={
/ip firewall nat move $firstRuleId destination=4
:put "The first rule with the comment 'ipsec mode-config' has been moved to the fourth position."
} else {
:put "The first rule does not have the comment 'ipsec mode-config'. No changes were made."
}
Doesn't move the NAT rule to 4 position. Does anybody know how to solve this?