Hai sobat, kali ini saya akan share tips cara untuk membuat auto update tunneling menggunakan protocol GRE.
skema :
[ Server Tunnel ] <> INET BROADBAND <> [ Tunnel Client IP Public ]
jika menggunakan GRE-TUNNEL maka membutuhkan tiktok ip public yang dituangkan dalam remote-address
mekanismenya :
- selalu update ip public
- selalu update remote-address pada gre tunnel
# Start:global currentIP# ubah di sini:global iface "PPPOE200":global ifacegre "gre-soni"# validasi file script:if ([:len [/file find name~"$ifacegre"]] = 0 ) do={/in gre export file=$ifacegre}:if ($currentIP in 10.0.0.0/8) do={:log error "re-dial...";/in pppoe-client disable $iface:delay 2/in pppoe-client enable $iface}/in pppoe-client monitor $iface once do={:set currentIP $"local-address" }:global p2p [/ip address get [:pick [find interface=$ifacegre] 0] network ]:global target [/in gre get $ifacegre remote-address ]:global statusgre [/in gre get $ifacegre running ];:if ($statusgre != true) do={/in gre set $ifacegre local-address=$currentIP:log error "$ifacegre error, kirim file"/file set contents="/in gre set $ifacegre remote-address=$currentIP" [find name~"$ifacegre"]:delay 2/tool fetch mode=ftp upload=yes src-path="$ifacegre.rsc" dst-path="$ifacegre.rsc" user=ftp password=ftp port=2121 address="$target"}
0 comments:
Post a Comment