- #Mikrotik routeros php api install#
- #Mikrotik routeros php api update#
- #Mikrotik routeros php api full#
- #Mikrotik routeros php api plus#
Output returns a message with configuration result: 2.4 GHz wlan configured sucessfully! connect ( "10.0.0.1", "myuser", "strongpassword" ) print ( router.
![mikrotik routeros php api mikrotik routeros php api](https://images.slideplayer.com/29/9462002/slides/slide_9.jpg)
#Mikrotik routeros php api full#
Output returns a message with full path of downloaded export file: /home/myuser/myfile.txtĬonfigure 2.4 GHz wlan interface from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. download_file ( "myfile.txt", "/home/myuser" )) router. Output returns a message with full path of downloaded export file: /home/myuser/export_Mikrotik_07-06-2021_21-42-33.rscĭownload any file from device from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. download_export ( "/home/myuser" )) router. ip hotspot profile set html-directory=flash/hotspotĮxport full config from device to local folder from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. interface wireless security-profiles set supplicant-identity=MikroTik Output returns device config export to terminal: # jun/01/2021 19:04:03 by RouterOS 6.47.9
![mikrotik routeros php api mikrotik routeros php api](https://img.yumpu.com/37803472/1/500x640/scripting-on-routeros-for-fun-and-profit-mum-mikrotik.jpg)
Output returns a message with full path of downloaded export file: /home/mysuser/backup_Mikrotik_07-06-2021_21-38-47.backupĮxport full config from device to terminal output from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. download_backup ( "/home/myuser" )) router. connect ( "10.0.0.1", "myuser", "strongpassword" ) # local_path examples: # For Linux: "/home/myuser" # For Windows: "C:/Users/myuser/Downloads" print ( router. Output returns command output without left spaces (left trim): time: 19:47:44ĭownload backup from device to local folder from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. send_command ( "/system clock print" )) router. Send custom command to device from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. In other case, returns the error itself: TrueĬreate a new enabled route to 172.16.0.0/25 with gateway 192.168.1.1 and distance of 5 from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. Output returns True if no errors are encountered.
#Mikrotik routeros php api update#
Update FTP service to enable it, set port to 2121 and allow connections only from 192.168.1.0/24 subnet from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. Output returns a list containing so many dictionaries as interfaces are found in device : get_interfaces () print ( interfaces ) router. Delete router object (optional) del routerĮxamples Get interfaces from device from routeros_ssh_connector import MikrotikDevice router = MikrotikDevice () router. get_interfaces () print ( interfaces ) 5. Call any of the following available methods GET NOTE: If 'port' parameter is not passed to method the default value is 22 4. connect ( "ip_address", "username", "password", "port" ) Create a new instance of them router = MikroTikDevice () 3. Import module from routeros_ssh_connector import MikrotikDevice 2.
#Mikrotik routeros php api install#
Installation pip install routeros_ssh_connector This project is still in development and will include new functionalities in the future.
![mikrotik routeros php api mikrotik routeros php api](https://miro.medium.com/max/1200/1*E0z5VYO0Gdz14G_oDJfFIA.jpeg)
#Mikrotik routeros php api plus#
This API allows you to get, update and create configuration on MikroTik devices plus other some extra utilities. A python-based SSH API for MikroTik devices