View Single Post
  #50  
Old 01.05.2012, 14:10
junke
Guest
 
Posts: n/a
Default RouterOS v5.15 (Mikrotik)

I tried to use Liveheader/Curl but it didn't work (Webfig uses Javascript and iframes). Finally, I managed to reconnect RouterOS v5.15 (Mikrotik) using SSH. I had to add a reconnect script on the router because /system reboot didn't work ("y"-button must be pressed).

It requires a Linux box running JDownloader. Windows users may try using PuTTYgen + PuTTY instead of ssh-keygen + ssh, but I haven't tried it.

Linux - Generate keys
  • ssh-keygen -t dsa -f ~/.ssh/id_dsa_mikrotik -P ""
Webfig - Create User, upload key, assign key
  • Files
    Upload: .ssh/id_dsa_mikrotik.pub
  • System - Groups - Add New
    Name: reconnect
    Policies: read,write,test
  • System - Users
    Name: reconnect
    Group: reconnect
    Allowed Address: <your LAN, e.g. 192.168.1.0/24>
  • System - SSH Keys - Import SSH Key
    User: reconnect
    Key File: id_dsa_mikrotik.pub

Linux - Login without password
  • echo "ssh -i ~/.ssh/id_dsa_mikrotik reconnect@<Router-IP>" >~/reconnect
    chmod 700 ~/reconnect
    ~/reconnect

RouterOS - Add reconnect script for pppoe-dsl, reconnect
(Replace pppoe-dsl by the name of the pppoe-client interface)
  • /system script add name=reconnect policy=read,write,test\
    source=":if ([/interface pppoe-client get pppoe-dsl disabled]=no) do={\
    \n /interface pppoe-client set pppoe-dsl disabled=yes\
    \n delay 5\
    \n /interface pppoe-client set pppoe-dsl disabled=no\
    \n}"
  • /ip address print
  • /system script run reconnect
  • /ip address print

Configure JDownloader, reconnect
  • Settings - Modules - Reconnection - Advanced
    First IP check wait time (sec): 10
    Max repeats (-1 = no limit): 0
    Time for ip change [sec]: 30
  • Settings - Modules - Reconnection - Methods - External - Interpreter: ~/reconnect
  • Change IP

Last edited by junke; 14.07.2012 at 05:24. Reason: corrected
Reply With Quote