mikrotik/IPSec Dynamic End points Updater.rsc
2024-08-25 18:12:22
# IPSec Peer/Policy Updater for Dynamic WAN addresses # ================================================== # CONFIGURATION START # ================================================== :local localfqdn "local.fqdn-or-ip.domain.tld" :local remotefqdn "remote.fqdn-or-ip.domain.tld" :local peertag "peer-comment" :local policytag "policy-comment" # ================================================== # CONFIGURATION END # ================================================== /ip dns cache flush :local localsite "0.0.0.0" :local remotesite "0.0.0.0" :if ( [ :tostr [ :toip $localfqdn ] ] != $localfqdn ) do={ :set localsite [ :resolve $localfqdn ] } else={ :set localsite $localfqdn } :if ( [ :tostr [ :toip $remotefqdn ] ] != $remotefqdn ) do={ :set remotesite [ :resolve $remotefqdn ] } else={ :set remotesite $remotefqdn } :log info ( "IPSec: setting local to ". $localsite ." and remote to ". $remotesite ."." ) /ip ipsec policy set [ /ip ipsec policy find comment="$policytag" ] sa-src-address=$localsite sa-dst-address=$remotesite /ip ipsec peer set [ /ip ipsec peer find comment="$peertag" ] address="$remotesite/32" # ================================================== # END OF SCRIPT # ==================================================
最新文章
- [AlwaysOn Availability Groups]AlwaysOn等待类型
- C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 大型软件系统客户端数据同步的问题解决
- [asp.net mvc 奇淫巧技] 01 - 封装上下文 - 在View中获取自定义的上下文
- IOS第二天多线程-04简化单例模式
- AppCan接入微信并且进行文字分享
- jQuery对象与dom对象的区别与相互转换
- java JDK8 学习笔记——第15章 通用API
- 严重: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it.
- mac osx 10.9安装配置macvim
- 借助csv用PHP生成excel文件
- Shell中脚本变量的作用域
- Python微信公众号开发
- springcloud情操陶冶-bootstrapContext(二)
- 三分钟明白 Activiti工作流 -- java运用
- c# 串口SerialPort
- Python 爬虫 某迅漫画 selemiun+plantomJS
- configure: error: Cannot find php-config. Please use --with-php-config=PATH
- 新式类单例模式之 __new__()
- java面试一、1.1基础
- 文件权限解释rwx