当前位置:网站首页>ROS dynamic IP port mapping

ROS dynamic IP port mapping

2020-12-08 10:46:07 osc_ qjkncsnp

  1. New port mapping ip--firewall--nat

  2. Script dynamic mapping with new port ,system--script

  3. Create a new plan ,system--schedule 

For convenience ( I named all the names 5000)

One 、

1. Set up port mapping ,ip--firewall--nat,dst Address It's my dial to get the news ip,comment Marked as 5000( Name at will )

2020-11-29 10_00_08- start-up .png

2.To Address It's intranet ip

2020-11-29 10_01_11- start-up .png







Two 、

1. Create a script to dynamically update the port map , Name it 5000,interval Is time

2020-11-29 10_05_05- start-up .png




2. among ken-test It's the name of the dynamic dial I created ,5000 It's port mapped comment

:global ipaddr [/ip address get [/ip address find interface=ken-test] address]

:set ipaddr [:pick $ipaddr 0 ([len $ipaddr] -3)]

:global oldip [/ip firewall nat get [/ip firewall nat find comment="5000"] dst-address]

:if ($ipaddr != $oldip) do={

:log info [/ip firewall nat set [/ip firewall nat find comment="5000"] dst-address=$ipaddr]

}

2020-11-29 10_29_02- start-up .png











3、 ... and 、

  1. Create a new project named 5000, At the red arrow 5000 by script Name

    2020-11-29 10_24_47- start-up .png











Four 、 The configuration is now complete , You can test dialing dynamics ip Replacement , Corresponding nat Whether the mapping has changed

版权声明
本文为[osc_ qjkncsnp]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/20201208104550568x.html