# 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. framework&&library's root

    框架和文件集合的路径应该是相对路径而不是绝对路径 写法如下图所示:

  2. 【Shell脚本学习20】Shell until循环

    until 循环执行一系列命令直至条件为 true 时停止.until 循环与 while 循环在处理方式上刚好相反.一般while循环优于until循环,但在某些时候,也只是极少数情况下,until ...

  3. [原创] Web UI自动化应用测试框架实践 - 概览

    之前为我们部门做的一个UI框架.不能纯粹解读为框架,主要是做了一些简单的分层设计,以解决稳定性.降低复杂性.提升可维护性以及快速构建测试用例等实际问题. 主要部分:1. 测试数据.主要提供测试类库需要 ...

  4. VMware系统运维(十四)部署虚拟化桌面 Horzion View Manager 5.2 配置许可

    1.通过网页访问https://conntionserver.testad.local/admin,打开如下图所示页面:输入用户名密码 2.进来以后配置View 许可,点击"编辑许可证&qu ...

  5. HDU 1598 find the most comfortable road (MST)

    find the most comfortable road Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  6. 借助linq2db使用Linq访问MySQL

    linq2db (@github)支持Linq访问多种数据库.使用它操作MySQL非常简单,但使用方式上有一些“新奇”,特记录一下. 下载安装(@NuGet)以及使用教程(@For MySQL). 使 ...

  7. kettle菜鸟学习笔记1----相关准备知识

    最近导师让给师弟师妹做个关于kettle的培训,瞬间囧了,kettle我也只是简单学过,连皮毛都算不上,而且,上次使用kettle已然是去年的事了…… 没办法,只好重新学习下,好在之前写了几个文档,也 ...

  8. iOS - 使用音乐的背景播放功能,使用MediaPlayer框架播放影片(Swift)

    1. 使用音乐的背景播放功能 (1) 导入音频播放框架 import AVFoundation (2) 创建音频播放对象 //初始化音频播放器对象,并将音频播放对象,作为视图控制器类的属相. var ...

  9. 20141104--SQL,查询习题,约束

    --创建学生信息表:学号,姓名,班级,性别,语文教师,数学教师,英语教师 --创建一个教师表:编号,姓名,课程,性别,出生日期 --创建一个分数表:语文,数学,外语,学号 --查询 语文成绩最高的学生 ...

  10. JAVA:IO流——File类

    1.掌握File 类的作用 2.可以使用File 类中的方法对文件进行操作 所有的 io 操作都保存在 java.io 包中. 构造方法:public File (String pathname) 直 ...