5/18/2019

RouterOS 重新拨号后,从接口获得新ip并更新规则

备忘,
范例
1
2
3
4
5
6
7
:global ipaddr [/ip address get [/ip address find interface=pppoe4plex] address]
:set ipaddr [:pick $ipaddr 0 ([len $ipaddr] -3)]
:global oldip [/ip firewall nat get [/ip firewall nat find comment="plexdstnat"] dst-address]
:if ($ipaddr != $oldip) do={
:log info [/ip firewall nat set [/ip firewall nat find comment="plexdstnat"] dst-address=$ipaddr]
:log info [/ip firewall nat set [/ip firewall nat find comment="plexsrcnat"] to-addresses=$ipaddr]
}

没有评论:

发表评论

甲骨文云ubuntu系统关防火墙

  6、Ubuntu系统 开放所有端口 iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -F Ubuntu镜像默认设置了Iptable规则,关闭它, ap...