Mikrotik | Forum Mikrotik Indonesia   Mikrotik Manual Mikrotik iSPY Mikrotik RSS Feed
This Logo is a Courtesy from RumahDowty

Go Back   Mikrotik | Forum Mikrotik Indonesia > Diskusi Mikrotik RouterOS > Scripting @ Mikrotik
iSpy My iTrade Register FAQ Members List Calendar Mark Forums Read

Diskusi [ask]Auto switch gateway 2 isp pada Scripting @ Mikrotik | Mikrotik | Forum Mikrotik Indonesia : halo para mikrotikers, ane mau tanya nih ane kan ada dua gateway isp, yg mau ...


Official Board Announcements
NEW
Kunjungi Forum Diskusi PROXY Linux di FMI
donasi



 
Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 18-07-2008, 16:50
eki.doank's Avatar
eki.doank eki.doank is offline
Newbie
 
Join Date: May 2008
Posts: 22
iTrader: (0)
Thanks: 2
Gain Thank You 2 Times in 1 Post
eki.doank is on a distinguished road
Talking [ask]Auto switch gateway 2 isp




halo para mikrotikers, ane mau tanya nih ane kan ada dua gateway isp, yg mau ane tanyain gimana bikin script auto switch gateway klo misal salah satu ispnya yg mati hanya akses intl-nya aja, soalnya slama ini seperti itu masalahnya intl-nya mati tapi akses lokal gak, sebelumnya thank's buat waktunya dan saya dah coba cari diforum tapi ga dapet2 threadnya...tahnks be4...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 21-07-2008, 21:56
lonthong2002's Avatar
lonthong2002 lonthong2002 is offline
Member Senior
 
Join Date: Jul 2007
Posts: 362
iTrader: (1)
Thanks: 19
Thanked 44 Times in 33 Posts
lonthong2002 will become famous soon enoughlonthong2002 will become famous soon enoughlonthong2002 will become famous soon enough
Send a message via MSN to lonthong2002 Send a message via Yahoo to lonthong2002
nunggu mode ON

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 21-07-2008, 22:57
yosanpro's Avatar
yosanpro yosanpro is offline
Moderator
 
Join Date: Nov 2007
Location: Bantul, Bantul, Yogyakarta
Posts: 1,838
iTrader: (1)
Thanks: 100
Thanked 501 Times in 301 Posts
yosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond repute
Send a message via Yahoo to yosanpro
Emang pake failover dengan distance ga bisa? Hmm... kalo gateway ping ok tapi international down emang susah juga sih...

Coba jawab yah, CMIIW (soalnya lom coba)...

Code:
/ip route add gateway=<gw isp1> distance=1 comment="utama"
/ip route add gateway=<gw isp2> distance=2 comment="cadangan"

/system script add name="autogw" source={
:if ([/ip route get [/ip route find comment="utama"] disabled]="yes") do={/ip route enable [/ip route find comment="utama"]} else={/ip route disable [/ip route find comment="utama"]}
}

/tool netwatch add host=<ip host internasional yg mo dicek> interval=15s timeout=2s down-script="autogw"
Jadi kalo pas yang utama ping ke internasional timeout otomatis gateway dengan distance=1 di disable dan gateway berpindah ke cadangan. Begitu ping internasional yang cadangan timeout gateway utama akan di enable lagi jadi pake yang utama.

Selamat mencoba, mudah-mudahan agak membantu.


Last edited by yosanpro : 24-07-2008 at 03:08. Reason: Ada code salah ketik, thanks to eki.doank for correction
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to yosanpro For This Useful Post:
  #4 (permalink)  
Old 22-07-2008, 05:14
zainalk29's Avatar
zainalk29 zainalk29 is offline
Donatur
 
Join Date: Aug 2007
Location: Yogyakarta and Banjarmasin
Posts: 671
iTrader: (0)
Thanks: 25
Thanked 162 Times in 99 Posts
zainalk29 is a splendid one to beholdzainalk29 is a splendid one to beholdzainalk29 is a splendid one to beholdzainalk29 is a splendid one to beholdzainalk29 is a splendid one to beholdzainalk29 is a splendid one to beholdzainalk29 is a splendid one to behold
Send a message via Yahoo to zainalk29
wah nambah ilmu baru lagi nih .... thx bgt

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 22-07-2008, 14:43
eki.doank's Avatar
eki.doank eki.doank is offline
Newbie
 
Join Date: May 2008
Posts: 22
iTrader: (0)
Thanks: 2
Gain Thank You 2 Times in 1 Post
eki.doank is on a distinguished road
kok bro scriptnya perintah "else" bad argumen ya....
Code:
[admin@PProduk] > /system script add name="autogw" source={
{... :if ([/ip route get [/ip route find comment="utama"] disabled]=
"yes") do={/ip route enable [/ip route find comment="utama"] else={/
ip route disable [/ip route find comment="utama"]}
bad argument name else (line 2 column 125)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 22-07-2008, 16:08
eki.doank's Avatar
eki.doank eki.doank is offline
Newbie
 
Join Date: May 2008
Posts: 22
iTrader: (0)
Thanks: 2
Gain Thank You 2 Times in 1 Post
eki.doank is on a distinguished road
oke script hanya ada kesalahan ketikan aja bro yosanpro, thanks buat scriptnya......case closed

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 26-07-2008, 17:49
lonthong2002's Avatar
lonthong2002 lonthong2002 is offline
Member Senior
 
Join Date: Jul 2007
Posts: 362
iTrader: (1)
Thanks: 19
Thanked 44 Times in 33 Posts
lonthong2002 will become famous soon enoughlonthong2002 will become famous soon enoughlonthong2002 will become famous soon enough
Send a message via MSN to lonthong2002 Send a message via Yahoo to lonthong2002
kok aku coba gak bisa ya.... memang betul kalau pas gw utama putus pindah ke cadangan... tapi kalau ping ke ip internasional sudah jalan lagi kenapa gak bisa balik ke gw utama? ,,, mohon koreksi atau aku yang salah ya....
tapi kalau dilihat di script nya ... sepertinya kok gak ada yang buat balikin ke gw utama ya..

huehuehu
mohon pencerahan


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 27-07-2008, 02:07
yosanpro's Avatar
yosanpro yosanpro is offline
Moderator
 
Join Date: Nov 2007
Location: Bantul, Bantul, Yogyakarta
Posts: 1,838
iTrader: (1)
Thanks: 100
Thanked 501 Times in 301 Posts
yosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond repute
Send a message via Yahoo to yosanpro
Oh... yang dimaksud gitu yah... Aku pikir pikirin lagi deh...

Kalau itu kembalinya ke gw utama cuman kalo ip internasional cadangan putus, jadi nggak mengecheck gw utama. Kalau pengin kembalinya pas gw utama normal lagi tunggu sebentar ya bro, baru menata otak buat mikirinnya nih...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to yosanpro For This Useful Post:
  #9 (permalink)  
Old 28-07-2008, 16:33
eki.doank's Avatar
eki.doank eki.doank is offline
Newbie
 
Join Date: May 2008
Posts: 22
iTrader: (0)
Thanks: 2
Gain Thank You 2 Times in 1 Post
eki.doank is on a distinguished road
untuk balikin lg ke gw utama klo ane buat baru lg di
Code:
/tool netwatch add host=<ip gw utama> interval=15s timeout=2s up-script="/ip route enable [find comment="gw utama"]"
, mohon maaf klo ane salah ketik, biasa masih amatir...hehe

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to eki.doank For This Useful Post:
  #10 (permalink)  
Old 29-07-2008, 14:41
xeon's Avatar
xeon xeon is online now
VIP Member
 
Join Date: Mar 2008
Location: http://www.dcsindo.com
Posts: 916
iTrader: (2)
Thanks: 0
Thanked 293 Times in 146 Posts
xeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enoughxeon will become famous soon enough
Send a message via Yahoo to xeon
Mungkin jika diperlukan, ada di sini :

http://www.dcsindo.com/index.php?option=com_content&view=article&id=48%3A load-balancing-dan-failover-untuk-traffic-international&Itemid=71

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to xeon For This Useful Post:
  #11 (permalink)  
Old 30-07-2008, 01:28
lonthong2002's Avatar
lonthong2002 lonthong2002 is offline
Member Senior
 
Join Date: Jul 2007
Posts: 362
iTrader: (1)
Thanks: 19
Thanked 44 Times in 33 Posts
lonthong2002 will become famous soon enoughlonthong2002 will become famous soon enoughlonthong2002 will become famous soon enough
Send a message via MSN to lonthong2002 Send a message via Yahoo to lonthong2002
thanks broo.. aku coba dulu yaaa...


aku juga coba dari

http://wiki.mikrotik.com/wiki/Improv... lover_Script


siapa tau bisa buat masukan suhu semua
hehehehe


Last edited by lonthong2002 : 30-07-2008 at 01:30.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 30-07-2008, 18:06
Mat Soleh's Avatar
Mat Soleh Mat Soleh is offline
VIP Member
 
Join Date: Jul 2007
Posts: 678
iTrader: (0)
Thanks: 13
Thanked 20 Times in 18 Posts
Mat Soleh is on a distinguished roadMat Soleh is on a distinguished road
ini kek model fail over gitu ya ???

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 01-08-2008, 16:16
yosanpro's Avatar
yosanpro yosanpro is offline
Moderator
 
Join Date: Nov 2007
Location: Bantul, Bantul, Yogyakarta
Posts: 1,838
iTrader: (1)
Thanks: 100
Thanked 501 Times in 301 Posts
yosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond repute
Send a message via Yahoo to yosanpro
Wew... kalo cuman failover gitu mah ga perlu script, tinggal set distance, check gateway diset ke ping, beres...

Kalo script yang aku buat kan untuk ngecheck traffic internasionalnya, jadi misalnya gateway ISP diping bisa tapi trafik international putus.

CMIIW...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to yosanpro For This Useful Post:
  #14 (permalink)  
Old 01-08-2008, 19:54
lonthong2002's Avatar
lonthong2002 lonthong2002 is offline
Member Senior
 
Join Date: Jul 2007
Posts: 362
iTrader: (1)
Thanks: 19
Thanked 44 Times in 33 Posts
lonthong2002 will become famous soon enoughlonthong2002 will become famous soon enoughlonthong2002 will become famous soon enough
Send a message via MSN to lonthong2002 Send a message via Yahoo to lonthong2002
@yosanpro Wew... kalo cuman failover gitu mah ga perlu script, tinggal set distance, check gateway diset ke ping, beres...

Kalo script yang aku buat kan untuk ngecheck traffic internasionalnya, jadi misalnya gateway ISP diping bisa tapi trafik international putus.

CMIIW...


bro... kalau di set gitu aja bisa gak ping nya juga ada setingan nya sampe 2s ....
soalnya takutnya kalau cuma ping aja... begitu beban banyak kan molor ping nya.. tapi gak putus.. atau ada cara untuk set ping nya ?

mohon pencerahan ... thanks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 01-08-2008, 21:06
yosanpro's Avatar
yosanpro yosanpro is offline
Moderator
 
Join Date: Nov 2007
Location: Bantul, Bantul, Yogyakarta
Posts: 1,838
iTrader: (1)
Thanks: 100
Thanked 501 Times in 301 Posts
yosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond reputeyosanpro has a reputation beyond repute
Send a message via Yahoo to yosanpro
lah di netwatch kan ada timeoutnya... tinggal diset itu ke 2000ms (2s)...

Eh... maksudnya yang pake distance yah... tar dulu, aku check manualnya...

Update: Setelah baca-baca dikit, kayaknya kalo pake distance ga bisa diset timeout pingnya deh... CMIIW...


Last edited by yosanpro : 01-08-2008 at 21:17.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to yosanpro For This Useful Post:
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto generate dari pos kasir tubagus Beginner Basics 5 28-06-2008 00:18
[Info] Script buat auto delete nice di address list dan auto import nice.rsc file okto_2005 Scripting @ Mikrotik 12 11-04-2008 08:28
tanya switch...??? irfan General Networking 2 28-03-2008 09:39
switch tidak bisa shaing mrgubrak General Networking 3 05-02-2008 14:17
(ASK) Menempatkan Mikrotik setelah switch bayong General Networking 3 17-01-2008 10:17


This Forum is Powered by Orion Net.

All times are GMT +8. The time now is 05:42.