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]
}

没有评论:

发表评论

卸载Win11小组件

  管理员权限运行CMD winget uninstall MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy