# 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

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

mikrotik/IPSec Dynamic End points Updater.rsc的更多相关文章

  1. netsh导入导出IPSec配置策略

    首先提一句: ipsec规则中,filter action为允许的比拒绝的优先级要高,其它的没有顺序关系,经测试验证! 参考:http://tech.techweb.com.cn/thread-354 ...

  2. [No0000F2]ip安全监视器

    IPSec快速式策略 @echo off :again set num= set fastpolicyname= set issoft= set livetime= set fps= setlocal ...

  3. Memory Layout (Virtual address space of a C process)

    Memory Layout (Virtual address space of a C process) 分类: C语言基础2012-12-06 23:16 2174人阅读 评论(0) 收藏 举报 f ...

  4. geeksforgeeks@ Minimum Points To Reach Destination (Dynamic Programming)

    http://www.practice.geeksforgeeks.org/problem-page.php?pid=91 Minimum Points To Reach Destination Gi ...

  5. RouterOS的MikroTik脚本从DNS更新IPSEC端的IP地址

    #Script for changing IPSEC address when DNS changes. #Script will iterate through all peers looking ...

  6. Reducing Snapshots to Points: A Visual Analytics Approach to Dynamic Network Exploration

    ---恢复内容开始--- 分析静态网络的方法:(1)节点链接图 (2)可视化邻接矩阵 and(3)hierarchical edge bundles. 分析网络演变的方法:(1)时间到时间的映射和(2 ...

  7. AIX上通过IPSEC进行IP包过滤

    AIX上的IPSEC 在AIX可以通过以下步骤打开IP Security smitty ipsec4 --> Start/Stop IP Security --> Start IP Sec ...

  8. Pointers and Dynamic Allocation of Memory

    METHOD 1: Consider the case where we do not know the number of elements in each row at compile time, ...

  9. Linux Programe/Dynamic Shared Library Entry/Exit Point && Glibc Entry Point/Function

    目录 . 引言 . C/C++运行库 . 静态Glibc && 可执行文件 入口/终止函数 . 动态Glibc && 可执行文件 入口/终止函数 . 静态Glibc & ...

随机推荐

  1. Joynet示例:知乎爬虫(搜索关键字相关回答,并下载其中的---图(mei)片(nv))

    先贴爬虫程序下载地址:http://pan.baidu.com/s/1c2lxl1e 下载解压后 可直接运行 其中的 run.bat:或者你手动打开命令行执行:Joynet examples\Spid ...

  2. 一次PostgreSql数据迁移,使用nodejs来完成

    2014-02-08 XX开放平台不允许使用站外的服务器了,可是我们的app都在站外,数据库也在站外,全都要求迁移到其云主机上(坑爹啊).我们在其云主机上仅有有限的资源,而且也有在运行中的数据库,要做 ...

  3. css+div网页设计(一)--基础知识

    css是网页制作不可缺少的部分,我会用三篇博客为大家展示css的基本用法. 关于css+div的整体结构图总结如下: 本篇博客主要介绍css的基础知识. 一.css概念; css(级联样式表):它是一 ...

  4. jQuery过滤选择器:not()方法使用介绍

    在jQuery的早期版本中,:not()筛选器只支持简单的选择器,说明我们传入到:not这个filter中的selector可以任意复杂,比如:not(div a) and :not(div,a) & ...

  5. 初识 Asp.Net内置对象之Server对象

    Server对象 Server对象定义了一个于Web服务器相关联的类提供对服务器上的方法和属性的访问,用于访问服务器上的资源. Server对象的常用属性 属性   MarhineName 获取服务器 ...

  6. 把当前时间(NSDate)转为字符串 - 获取当前时间的Day

    1.把当前时间转为字符串 (NSDate与北京时间相隔8小时,格式化之后就是北京时间) NSDate *date = [NSDate date]; NSDateFormatter *dateForma ...

  7. SQLSERVER数据库中的 时间函数

    一.sql server日期时间函数 Sql Server中的日期与时间函数 1.  当前系统日期.时间 select getdate() 2. dateadd  在向指定日期加上一段时间的基础上,返 ...

  8. php中一串数子的转化

    echo "<meta charset=utf-8>"; echo "笔试题测试"; $str = "123456780"; $ ...

  9. JavaScript--DOM基础(19)

    // DOM(Document Object Model)即文档对象模型,针对HTML和XML文档的API(应用程序接口); // DOM描绘了一个层次化的节点树,运行开发人员可以添加/移除和修改页面 ...

  10. 非web项目中使用XDT的实例(续)

    简化 上个实例中,我们是引用了target文件来遍历项目中的xdt项. 当项目比较小,我们又只需要针对固定的config文件进行更替时,可以使用更简化的方法 不进行项目配置文件中的插入<Impo ...