每天都学一点

ROS的ADSL多线映射脚本

23 03月
作者:林健|分类:Mikrotik

映射脚本自动绑定到默认路由的接口更新IP

--------------对NAT规则备注名进行查找-----------------
:global adcmname "3389"
:global adgw [/ip route get [/ip route find static=yes active=yes dynamic=yes distance=1] gateway]
:global ip [/ip add get [find network=$adgw] address]
:global newip [:pick $ip 0 [:find $ip "/"]]
:global oldip [/ip fi nat get [/ip fi nat find comment=$adcmname] dst-address]
:if ($newip != $oldip) do={
:log info [/ip fi nat set [/ip firewall nat find comment=$adcmname] dst-address=$newip]
}


    浏览2 评论0
    返回
    目录
    返回
    首页
    创建ROSLOG项目 MikroTik RouterOS统计在线人数专业版

    发表评论