# 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

# ==================================================

最新文章

  1. [AlwaysOn Availability Groups]AlwaysOn等待类型
  2. C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 大型软件系统客户端数据同步的问题解决
  3. [asp.net mvc 奇淫巧技] 01 - 封装上下文 - 在View中获取自定义的上下文
  4. IOS第二天多线程-04简化单例模式
  5. AppCan接入微信并且进行文字分享
  6. jQuery对象与dom对象的区别与相互转换
  7. java JDK8 学习笔记——第15章 通用API
  8. 严重: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it.
  9. mac osx 10.9安装配置macvim
  10. 借助csv用PHP生成excel文件
  11. Shell中脚本变量的作用域
  12. Python微信公众号开发
  13. springcloud情操陶冶-bootstrapContext(二)
  14. 三分钟明白 Activiti工作流 -- java运用
  15. c# 串口SerialPort
  16. Python 爬虫 某迅漫画 selemiun+plantomJS
  17. configure: error: Cannot find php-config. Please use --with-php-config=PATH
  18. 新式类单例模式之 __new__()
  19. java面试一、1.1基础
  20. 文件权限解释rwx

热门文章

  1. java中异步调用的解决方法
  2. Linux下C/C++程序开发管理(makefile)
  3. VMware系统运维(五)安装SSO vCenter Single Sign-On
  4. Umbraco列表分页
  5. jQuery选择器之基本选择器Demo
  6. 2013 ACM/ICPC Asia Regional Online —— Warmup2
  7. 在centos7中添加一个新用户并授权
  8. 关于ios项目沙盒中的文件和Xcode项目创建的文件
  9. Charles 应用
  10. C#_数组