26
Янв

Скрипт динамического обновления ip в политиках IPsec Mikrotik

Допустим мы настроили шифрованный L2TP тунель с IPsec к VDS, но ip нашего провайдера может изменится, тогда политики IPsec станут не рабочими. Предлагаю использовать следующий скрипт.
Где:
pass — это комментарий нашей политики
ISP2 — наш интерфейс с интернет соединением

:global ipsecold [ /ip ipsec policy get [find comment="pass"] sa-src-address]
 :global ipsecoldsa [ /ip ipsec policy get [find comment="pass"] src-address]
 :global ipsec [ /ip address get [find interface="ISP2"] address ]
 :for i from=( [:len $ipsec] - 1) to=0 do={
 :if ( [:pick $ipsec $i] = "/") do={
 :set ipsec [:pick $ipsec 0 $i];
 }
 }
 :global ipsecsa ([:pick "$ipsec" 0 ([:len $ipsec] - 0)]."/32")
 :if ($ipsecoldsa != $ipsecsa) do={
 /ip ipsec policy set [find comment="pass"] src-address=$ipsecsa sa-src-address=$ipsec;
 }

Обратная связь

    The average number of adverse effects was 3. T max is 23 minutes in females and 32 minutes in males. What other drugs will affect doxercalciferol Viagra natural sin receta. Archived from the original on 2009-08-14.

    Talk to your doctor before using this form of cefadroxil if you have diabetes. What should I tell my healthcare team before starting CABLIVI? There is no FDA guidance on the use of Tetracycline (oral) with respect to specific gender populations https://www.apotheke-rezeptfreie.com/. Opper K, Uder S, Song K Development of Heterogeneous and Homogeneous Platforms for Rapid Analysis of DNA-Protein Interactions.