SlideShare a Scribd company logo
1 of 24
Download to read offline
www.glcnetworks.com
API
(Application Programming Interface)
GLC webinar, 29 December 2016
Achmad Mardiansyah
achmad@glcnetworks.com
GLC Networks, Indonesia
www.glcnetworks.com
Agenda
● Introduction
● API intro
● Mikrotik API
● Demo
● Q & A
2
www.glcnetworks.com
What is GLC?
● Garda Lintas Cakrawala (www.glcnetworks.com)
● An Indonesian company
● Located in Bandung
● Areas: Training, IT Consulting
● Mikrotik Certified Training Partner
● Mikrotik Certified Consultant
● Mikrotik distributor
3
www.glcnetworks.com
About GLC webinar?
● First webinar: january 1, 2010 (title:
tahun baru bersama solaris - new
year with solaris OS)
● As a sharing event with various
topics: linux, networking, wireless,
database, programming, etc
● Regular schedule: every 2 weeks
● Irregular schedule: as needed
● Checking schedule:
http://www.glcnetworks.com/main/sc
hedule
● You are invited to be a presenter
○ No need to be an expert
○ This is a forum for sharing: knowledge,
experiences, information
4
www.glcnetworks.com
Trainer Introduction
● Name: Achmad Mardiansyah
● Base: bandung, Indonesia
● Linux user since 1999
● Mikrotik user since 2007
● Certified Trainer (MTCNA/RE/WE/UME/INE/TCE)
● Mikrotik Certified Consultant
● Work: Telco engineer, Sysadmin, PHP programmer,
and Lecturer
● Personal website: http://achmadjournal.com
● More info:
http://au.linkedin.com/in/achmadmardiansyah
5
www.glcnetworks.com
Please introduce yourself
● Your name
● Your company/university?
● Your networking experience?
● Your mikrotik experience?
● Your expectation from this course?
6
www.glcnetworks.com
What is Mikrotik?
● Name of a company
● A brand
● A program (e.g. mikrotik academy)
● Headquarter: Riga, Latvia
7
www.glcnetworks.com
What are mikrotik products?
● Router OS
○ The OS. Specialized for networking
○ Website: www.mikrotik.com/download
● RouterBoard
○ The hardware
○ RouterOS installed
○ Website: www.routerboard.com
8
www.glcnetworks.com
What Router OS can do?
● Go to www.mikrotik.com
○ Download: what_is_routeros.pdf
○ Download: product catalog
○ Download: newsletter
9
www.glcnetworks.com
What are Mikrotik training & certifications?
10
Certificate validity is 3 years
www.glcnetworks.com
API intro
11
www.glcnetworks.com
What is API?
● API: Application Programming Interface
● a set of subroutine definitions, protocols, and tools for building application
software.
● defined methods of communication between various software components
● API implementation are varied:
○ web-based system - using HTTP (popular)
○ operating system based - e.g. when developing daemon (apache, nginx)
○ Hardware based - e.g. when accessing microcontroller
○ etc..
12
www.glcnetworks.com
Why use API?
● For machine to machine communication (e.g. exchange rate, provisioning,
single sign on, etc)
● For automation (e.g. facebook login, twitter login, etc)
● To develop advanced services (uber, gojek, etc. they use google map API)
● For security. Limitation of access rights
● Many other reasons...
13
www.glcnetworks.com
Mikrotik API
14
www.glcnetworks.com
Mikrotik API
● Available since version 3
● Running on TCP port 8728 (http), or TCP
port 8729 (https)
● API service is disabled by default
● API is intended for machines, not human
15
Without API
With API
www.glcnetworks.com
Why use Mikrotik API?
● Security: define more fine-grained security, indirect access to the devices
● Provisioning: add/delete/update user
● Monitoring
● Customised access for user
● Develop a new service (fb login, single-sign-on, etc)
● Communicate with external application (e.g. billing system, monitoring,
self-service application)
● API is more rigid and consistent (suitable for machines). Unlike ssh (ssh is for
human interface)
● etc...
1616
Accessing
mikrotik API
www.glcnetworks.com
How to access mikrotik API?
● You need to understand programming language. E.g. PHP
● You need to provide a middle server that connects to mikrotik devices
● Make sure no firewall is blocking the mikrotik API
● API service need to be activated
● Make sure the user has api privileges
● Tips: only allow specific IP address that can access mikrotik API
17
www.glcnetworks.com
DEMO
18
www.glcnetworks.com
Using Mikrotik API
In this example we will use:
● PHP programming language
● Mikrotik PHP class by BenMenking
(https://github.com/BenMenking/routeros-api)
● A webserver that can access mikrotik devices
191919
Accessing
mikrotik API
www.glcnetworks.com
Example script (setup initial connection)
require('routeros_api.class.php'); //include api class
define('MIKROTIK_IP', '192.168.88.1'); //mikrotikIP address
define('MIKROTIK_USERNAME', 'admin'); //mikrotik username
define('MIKROTIK_PASSWORD', 'secret'); //mikrotik password
$API = new routeros_api(); //create a new instance
$API->debug = true; //activate debug
$API->connect(MIKROTIK_IP, MIKROTIK_USERNAME,
MIKROTIK_PASSWORD); // connect to mikrotik device
20
www.glcnetworks.com
add hotspot user using API (prepare user)
$user = array(1 => array('name' => 'user1', 'password' => 'pass1'),
2 => array('name' => 'user2', 'password' => 'pass2'),
3 => array('name' => 'user3', 'password' => 'pass3'),
4 => array('name' => 'user4', 'password' => 'pass4'),
5 => array('name' => 'user5', 'password' => 'pass5'),
);
foreach($user as $tmp) {
$username="=name=";
$username.=$tmp['name'];
$pass="=password=";
$pass.=$tmp['password'];
$server="=server=";
$server.=SERVER;$profile="=profile=";
$profile.=PROFILE;
21
www.glcnetworks.com
add hotspot user using API (add user)
$API->write('/ip/hotspot/user/add',false); //execute add command
$API->write($username, false); //insert username
$API->write($pass, false); // insert password
$API->write($server, false); //insert server
$API->write($profile); //insert profile name
$ARRAY = $API->read(); // this is for debug
echo "<pre>";
print_r($ARRAY);
echo "</pre>";
}
$API->disconnect(); //disconnect API
22
www.glcnetworks.com
Interested?
Just come to our
training...
Special price for webinar
attendees...
23
www.glcnetworks.com
End of slides
● Thank you for your attention
● Please submit your feedback: http://bit.ly/glcfeedback
● Like our facebook page: “GLC networks”
● Stay tune with our schedule
24

More Related Content

What's hot

Tunnel vs VPN on Mikrotik
Tunnel vs VPN on MikrotikTunnel vs VPN on Mikrotik
Tunnel vs VPN on MikrotikGLC Networks
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikGLC Networks
 
MikroTik Security
MikroTik SecurityMikroTik Security
MikroTik SecurityRofiq Fauzi
 
Mikrotik Load Balancing with PCC
Mikrotik Load Balancing with PCCMikrotik Load Balancing with PCC
Mikrotik Load Balancing with PCCGLC Networks
 
Zabbix for Monitoring
Zabbix for MonitoringZabbix for Monitoring
Zabbix for MonitoringGLC Networks
 
Traffic Engineering Using Segment Routing
Traffic Engineering Using Segment Routing Traffic Engineering Using Segment Routing
Traffic Engineering Using Segment Routing Cisco Canada
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusDashamir Hoxha
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backendSebastian Poxhofer
 
MikroTik & RouterOS
MikroTik & RouterOSMikroTik & RouterOS
MikroTik & RouterOSFaelix Ltd
 
Cisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advanceCisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advanceBertrand Duvivier
 
OSPF On Router OS7
OSPF On Router OS7OSPF On Router OS7
OSPF On Router OS7GLC Networks
 
Best Current Practice (BCP) 38 Ingress Filtering for Security
Best Current Practice (BCP) 38 Ingress Filtering for SecurityBest Current Practice (BCP) 38 Ingress Filtering for Security
Best Current Practice (BCP) 38 Ingress Filtering for SecurityGLC Networks
 

What's hot (20)

Tunnel vs VPN on Mikrotik
Tunnel vs VPN on MikrotikTunnel vs VPN on Mikrotik
Tunnel vs VPN on Mikrotik
 
BGP on mikrotik
BGP on mikrotikBGP on mikrotik
BGP on mikrotik
 
Mikrotik firewall filter
Mikrotik firewall filterMikrotik firewall filter
Mikrotik firewall filter
 
BGP filter with mikrotik
BGP filter with mikrotikBGP filter with mikrotik
BGP filter with mikrotik
 
Mikrotik fastpath
Mikrotik fastpathMikrotik fastpath
Mikrotik fastpath
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
 
MikroTik Security
MikroTik SecurityMikroTik Security
MikroTik Security
 
EOIP Deep Dive
EOIP Deep DiveEOIP Deep Dive
EOIP Deep Dive
 
Mikrotik Load Balancing with PCC
Mikrotik Load Balancing with PCCMikrotik Load Balancing with PCC
Mikrotik Load Balancing with PCC
 
Mikro tik advanced training
Mikro tik advanced trainingMikro tik advanced training
Mikro tik advanced training
 
Zabbix for Monitoring
Zabbix for MonitoringZabbix for Monitoring
Zabbix for Monitoring
 
Traffic Engineering Using Segment Routing
Traffic Engineering Using Segment Routing Traffic Engineering Using Segment Routing
Traffic Engineering Using Segment Routing
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and Radius
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backend
 
Zabbix conference 2018v2
Zabbix conference 2018v2Zabbix conference 2018v2
Zabbix conference 2018v2
 
MikroTik & RouterOS
MikroTik & RouterOSMikroTik & RouterOS
MikroTik & RouterOS
 
Cisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advanceCisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advance
 
OSPF On Router OS7
OSPF On Router OS7OSPF On Router OS7
OSPF On Router OS7
 
Best Current Practice (BCP) 38 Ingress Filtering for Security
Best Current Practice (BCP) 38 Ingress Filtering for SecurityBest Current Practice (BCP) 38 Ingress Filtering for Security
Best Current Practice (BCP) 38 Ingress Filtering for Security
 
Mikrotik Hotspot
Mikrotik HotspotMikrotik Hotspot
Mikrotik Hotspot
 

Viewers also liked

Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750
Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750 Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750
Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750 Arif Wahyudi
 
Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...
Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...
Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...Rudy Hendrawan
 
Setting mikrotik warnet i
Setting mikrotik warnet iSetting mikrotik warnet i
Setting mikrotik warnet iDenny Hotspot
 
SETING DAN KONFIGURASI ROUTERBOARD MIKROTIK RB 750 METODE TEX
SETING DAN KONFIGURASI ROUTERBOARD  MIKROTIK RB 750 METODE TEXSETING DAN KONFIGURASI ROUTERBOARD  MIKROTIK RB 750 METODE TEX
SETING DAN KONFIGURASI ROUTERBOARD MIKROTIK RB 750 METODE TEXKadek Kamastika
 
GLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotikGLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotikAchmad Mardiansyah
 
Setting mikrotik untuk game online campur browsing
Setting mikrotik untuk game online campur browsingSetting mikrotik untuk game online campur browsing
Setting mikrotik untuk game online campur browsingimanariepin24
 
cara membuat hotspot dengan MikroTik di VirtualBox
cara membuat hotspot dengan MikroTik di VirtualBoxcara membuat hotspot dengan MikroTik di VirtualBox
cara membuat hotspot dengan MikroTik di VirtualBoxariweda2323
 
Limiting bandwidth of specific destination based on address list
Limiting bandwidth of specific destination based on address listLimiting bandwidth of specific destination based on address list
Limiting bandwidth of specific destination based on address listAchmad Mardiansyah
 
Konfigurasi mikrotik (virtualbox)
Konfigurasi mikrotik (virtualbox) Konfigurasi mikrotik (virtualbox)
Konfigurasi mikrotik (virtualbox) Mas Tobel
 
Langkah langkah membuat hotspot MikroTik di virtualbox
Langkah langkah membuat hotspot MikroTik di virtualboxLangkah langkah membuat hotspot MikroTik di virtualbox
Langkah langkah membuat hotspot MikroTik di virtualboxrizky dk
 
WIRELESS SECURITY ON MIKROTIK TUGAS 1 KOMUNIKASI NIRKABEL
WIRELESS SECURITY ON MIKROTIK TUGAS  1  KOMUNIKASI NIRKABELWIRELESS SECURITY ON MIKROTIK TUGAS  1  KOMUNIKASI NIRKABEL
WIRELESS SECURITY ON MIKROTIK TUGAS 1 KOMUNIKASI NIRKABELSutni_Wulan_Sari_Puasa
 
Konfigurasi mikrotik-dasar-hotspot-dan-warnet
Konfigurasi mikrotik-dasar-hotspot-dan-warnetKonfigurasi mikrotik-dasar-hotspot-dan-warnet
Konfigurasi mikrotik-dasar-hotspot-dan-warnetR Arju Damar
 
Routing fundamentals with mikrotik
Routing fundamentals with mikrotikRouting fundamentals with mikrotik
Routing fundamentals with mikrotikAchmad Mardiansyah
 
7 superchannel mikrotik sutiyo
7 superchannel mikrotik sutiyo7 superchannel mikrotik sutiyo
7 superchannel mikrotik sutiyoAde Tamin
 

Viewers also liked (20)

Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750
Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750 Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750
Sistem Keamanan dan Optimalisasi Bandwidth menggunakan MikroTik RB750
 
Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...
Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...
Jurnal manajemen bandwidth internet dengan router mikrotik di sma negeri sari...
 
Setting mikrotik warnet i
Setting mikrotik warnet iSetting mikrotik warnet i
Setting mikrotik warnet i
 
Mikrotik the dude
Mikrotik the dudeMikrotik the dude
Mikrotik the dude
 
Mikrotik firewall raw table
Mikrotik firewall raw tableMikrotik firewall raw table
Mikrotik firewall raw table
 
SETING DAN KONFIGURASI ROUTERBOARD MIKROTIK RB 750 METODE TEX
SETING DAN KONFIGURASI ROUTERBOARD  MIKROTIK RB 750 METODE TEXSETING DAN KONFIGURASI ROUTERBOARD  MIKROTIK RB 750 METODE TEX
SETING DAN KONFIGURASI ROUTERBOARD MIKROTIK RB 750 METODE TEX
 
IPv6 on Mikrotik
IPv6 on MikrotikIPv6 on Mikrotik
IPv6 on Mikrotik
 
GLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotikGLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotik
 
Setting mikrotik untuk game online campur browsing
Setting mikrotik untuk game online campur browsingSetting mikrotik untuk game online campur browsing
Setting mikrotik untuk game online campur browsing
 
cara membuat hotspot dengan MikroTik di VirtualBox
cara membuat hotspot dengan MikroTik di VirtualBoxcara membuat hotspot dengan MikroTik di VirtualBox
cara membuat hotspot dengan MikroTik di VirtualBox
 
Limiting bandwidth of specific destination based on address list
Limiting bandwidth of specific destination based on address listLimiting bandwidth of specific destination based on address list
Limiting bandwidth of specific destination based on address list
 
Konfigurasi mikrotik (virtualbox)
Konfigurasi mikrotik (virtualbox) Konfigurasi mikrotik (virtualbox)
Konfigurasi mikrotik (virtualbox)
 
Mikrotik metarouter
Mikrotik metarouterMikrotik metarouter
Mikrotik metarouter
 
Langkah langkah membuat hotspot MikroTik di virtualbox
Langkah langkah membuat hotspot MikroTik di virtualboxLangkah langkah membuat hotspot MikroTik di virtualbox
Langkah langkah membuat hotspot MikroTik di virtualbox
 
VLAN on mikrotik
VLAN on mikrotikVLAN on mikrotik
VLAN on mikrotik
 
WIRELESS SECURITY ON MIKROTIK TUGAS 1 KOMUNIKASI NIRKABEL
WIRELESS SECURITY ON MIKROTIK TUGAS  1  KOMUNIKASI NIRKABELWIRELESS SECURITY ON MIKROTIK TUGAS  1  KOMUNIKASI NIRKABEL
WIRELESS SECURITY ON MIKROTIK TUGAS 1 KOMUNIKASI NIRKABEL
 
Konfigurasi mikrotik-dasar-hotspot-dan-warnet
Konfigurasi mikrotik-dasar-hotspot-dan-warnetKonfigurasi mikrotik-dasar-hotspot-dan-warnet
Konfigurasi mikrotik-dasar-hotspot-dan-warnet
 
Routing fundamentals with mikrotik
Routing fundamentals with mikrotikRouting fundamentals with mikrotik
Routing fundamentals with mikrotik
 
7 superchannel mikrotik sutiyo
7 superchannel mikrotik sutiyo7 superchannel mikrotik sutiyo
7 superchannel mikrotik sutiyo
 
Laporan PRAKERIN MIKROTIK
Laporan PRAKERIN MIKROTIKLaporan PRAKERIN MIKROTIK
Laporan PRAKERIN MIKROTIK
 

Similar to Mikrotik API

Building Web Server with Linux
Building Web Server with LinuxBuilding Web Server with Linux
Building Web Server with LinuxGLC Networks
 
Using Control-Webpanel for Hosting Service - Part 1
Using Control-Webpanel for Hosting Service - Part 1Using Control-Webpanel for Hosting Service - Part 1
Using Control-Webpanel for Hosting Service - Part 1GLC Networks
 
Using protocol analyzer on mikrotik
Using protocol analyzer on mikrotikUsing protocol analyzer on mikrotik
Using protocol analyzer on mikrotikAchmad Mardiansyah
 
Choosing Mikrotik Platform x86 vs chr
Choosing Mikrotik Platform x86 vs chrChoosing Mikrotik Platform x86 vs chr
Choosing Mikrotik Platform x86 vs chrGLC Networks
 
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Your Application Deserves Better than Kubernetes Ingress: Istio vs. KubernetesYour Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Your Application Deserves Better than Kubernetes Ingress: Istio vs. KubernetesMirantis
 
[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?
[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?
[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?WSO2
 
Using Kubernetes to Provide Services
Using Kubernetes to Provide ServicesUsing Kubernetes to Provide Services
Using Kubernetes to Provide ServicesGLC Networks
 
GIT as Mikrotik Configuration Management
GIT as Mikrotik Configuration ManagementGIT as Mikrotik Configuration Management
GIT as Mikrotik Configuration ManagementGLC Networks
 
Dynamic Website with Python
Dynamic Website with PythonDynamic Website with Python
Dynamic Website with PythonGLC Networks
 
Using Docker Platform to Provide Services
Using Docker Platform to Provide ServicesUsing Docker Platform to Provide Services
Using Docker Platform to Provide ServicesGLC Networks
 
Building API with PHP
Building API with PHPBuilding API with PHP
Building API with PHPGLC Networks
 
Introduction to Jhipster
Introduction to JhipsterIntroduction to Jhipster
Introduction to JhipsterKnoldus Inc.
 
Using an API Gateway for Microservices
Using an API Gateway for MicroservicesUsing an API Gateway for Microservices
Using an API Gateway for MicroservicesNGINX, Inc.
 
Socket Programming with Python
Socket Programming with PythonSocket Programming with Python
Socket Programming with PythonGLC Networks
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementNuwan Dias
 
Manage Your Router with Dynamic Public IP
Manage Your Router with Dynamic Public IPManage Your Router with Dynamic Public IP
Manage Your Router with Dynamic Public IPGLC Networks
 
Single Sign On (SSO) Services with Free/Open Source Software
Single Sign On (SSO) Services with Free/Open Source SoftwareSingle Sign On (SSO) Services with Free/Open Source Software
Single Sign On (SSO) Services with Free/Open Source SoftwareTonny Adhi Sabastian
 
WSO2 API Microgateway for Easier Development and Greater Scalability
WSO2 API Microgateway for Easier Development and Greater ScalabilityWSO2 API Microgateway for Easier Development and Greater Scalability
WSO2 API Microgateway for Easier Development and Greater ScalabilityWSO2
 
Anypoint new features_coimbatore_mule_meetup
Anypoint new features_coimbatore_mule_meetupAnypoint new features_coimbatore_mule_meetup
Anypoint new features_coimbatore_mule_meetupMergeStack
 

Similar to Mikrotik API (20)

Building Web Server with Linux
Building Web Server with LinuxBuilding Web Server with Linux
Building Web Server with Linux
 
Using Control-Webpanel for Hosting Service - Part 1
Using Control-Webpanel for Hosting Service - Part 1Using Control-Webpanel for Hosting Service - Part 1
Using Control-Webpanel for Hosting Service - Part 1
 
Using protocol analyzer on mikrotik
Using protocol analyzer on mikrotikUsing protocol analyzer on mikrotik
Using protocol analyzer on mikrotik
 
Choosing Mikrotik Platform x86 vs chr
Choosing Mikrotik Platform x86 vs chrChoosing Mikrotik Platform x86 vs chr
Choosing Mikrotik Platform x86 vs chr
 
SSL certificate with mikrotik
SSL certificate with mikrotikSSL certificate with mikrotik
SSL certificate with mikrotik
 
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Your Application Deserves Better than Kubernetes Ingress: Istio vs. KubernetesYour Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
 
[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?
[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?
[APIdays NY] Managing the usage of Asynchronous APIs: What does it take?
 
Using Kubernetes to Provide Services
Using Kubernetes to Provide ServicesUsing Kubernetes to Provide Services
Using Kubernetes to Provide Services
 
GIT as Mikrotik Configuration Management
GIT as Mikrotik Configuration ManagementGIT as Mikrotik Configuration Management
GIT as Mikrotik Configuration Management
 
Dynamic Website with Python
Dynamic Website with PythonDynamic Website with Python
Dynamic Website with Python
 
Using Docker Platform to Provide Services
Using Docker Platform to Provide ServicesUsing Docker Platform to Provide Services
Using Docker Platform to Provide Services
 
Building API with PHP
Building API with PHPBuilding API with PHP
Building API with PHP
 
Introduction to Jhipster
Introduction to JhipsterIntroduction to Jhipster
Introduction to Jhipster
 
Using an API Gateway for Microservices
Using an API Gateway for MicroservicesUsing an API Gateway for Microservices
Using an API Gateway for Microservices
 
Socket Programming with Python
Socket Programming with PythonSocket Programming with Python
Socket Programming with Python
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API Management
 
Manage Your Router with Dynamic Public IP
Manage Your Router with Dynamic Public IPManage Your Router with Dynamic Public IP
Manage Your Router with Dynamic Public IP
 
Single Sign On (SSO) Services with Free/Open Source Software
Single Sign On (SSO) Services with Free/Open Source SoftwareSingle Sign On (SSO) Services with Free/Open Source Software
Single Sign On (SSO) Services with Free/Open Source Software
 
WSO2 API Microgateway for Easier Development and Greater Scalability
WSO2 API Microgateway for Easier Development and Greater ScalabilityWSO2 API Microgateway for Easier Development and Greater Scalability
WSO2 API Microgateway for Easier Development and Greater Scalability
 
Anypoint new features_coimbatore_mule_meetup
Anypoint new features_coimbatore_mule_meetupAnypoint new features_coimbatore_mule_meetup
Anypoint new features_coimbatore_mule_meetup
 

More from Achmad Mardiansyah

Backup & Restore (BR) in Solaris OS
Backup & Restore (BR) in Solaris OSBackup & Restore (BR) in Solaris OS
Backup & Restore (BR) in Solaris OSAchmad Mardiansyah
 
Mikrotik User Meeting Manila: bgp vs ospf
Mikrotik User Meeting Manila: bgp vs ospfMikrotik User Meeting Manila: bgp vs ospf
Mikrotik User Meeting Manila: bgp vs ospfAchmad Mardiansyah
 
PHPID online Learning #6 Migration from procedural to OOP
PHPID online Learning #6 Migration from procedural to OOPPHPID online Learning #6 Migration from procedural to OOP
PHPID online Learning #6 Migration from procedural to OOPAchmad Mardiansyah
 
Troubleshooting load balancing
Troubleshooting load balancingTroubleshooting load balancing
Troubleshooting load balancingAchmad Mardiansyah
 
ISP load balancing with mikrotik nth
ISP load balancing with mikrotik nthISP load balancing with mikrotik nth
ISP load balancing with mikrotik nthAchmad Mardiansyah
 
Jumpstart your router with mikrotik quickset
Jumpstart your router with mikrotik quicksetJumpstart your router with mikrotik quickset
Jumpstart your router with mikrotik quicksetAchmad Mardiansyah
 
Routing Information Protocol (RIP) on Mikrotik
Routing Information Protocol (RIP) on MikrotikRouting Information Protocol (RIP) on Mikrotik
Routing Information Protocol (RIP) on MikrotikAchmad Mardiansyah
 
Connection load balancing with mikrotik [workshop]
Connection load balancing with mikrotik [workshop]Connection load balancing with mikrotik [workshop]
Connection load balancing with mikrotik [workshop]Achmad Mardiansyah
 

More from Achmad Mardiansyah (16)

01 introduction to mpls
01 introduction to mpls 01 introduction to mpls
01 introduction to mpls
 
Solaris 10 Container
Solaris 10 ContainerSolaris 10 Container
Solaris 10 Container
 
Backup & Restore (BR) in Solaris OS
Backup & Restore (BR) in Solaris OSBackup & Restore (BR) in Solaris OS
Backup & Restore (BR) in Solaris OS
 
Mikrotik User Meeting Manila: bgp vs ospf
Mikrotik User Meeting Manila: bgp vs ospfMikrotik User Meeting Manila: bgp vs ospf
Mikrotik User Meeting Manila: bgp vs ospf
 
PHPID online Learning #6 Migration from procedural to OOP
PHPID online Learning #6 Migration from procedural to OOPPHPID online Learning #6 Migration from procedural to OOP
PHPID online Learning #6 Migration from procedural to OOP
 
Troubleshooting load balancing
Troubleshooting load balancingTroubleshooting load balancing
Troubleshooting load balancing
 
ISP load balancing with mikrotik nth
ISP load balancing with mikrotik nthISP load balancing with mikrotik nth
ISP load balancing with mikrotik nth
 
Mikrotik firewall mangle
Mikrotik firewall mangleMikrotik firewall mangle
Mikrotik firewall mangle
 
Wireless CSMA with mikrotik
Wireless CSMA with mikrotikWireless CSMA with mikrotik
Wireless CSMA with mikrotik
 
Mikrotik VRRP
Mikrotik VRRPMikrotik VRRP
Mikrotik VRRP
 
Mikrotik fasttrack
Mikrotik fasttrackMikrotik fasttrack
Mikrotik fasttrack
 
Jumpstart your router with mikrotik quickset
Jumpstart your router with mikrotik quicksetJumpstart your router with mikrotik quickset
Jumpstart your router with mikrotik quickset
 
Mikrotik firewall NAT
Mikrotik firewall NATMikrotik firewall NAT
Mikrotik firewall NAT
 
Routing Information Protocol (RIP) on Mikrotik
Routing Information Protocol (RIP) on MikrotikRouting Information Protocol (RIP) on Mikrotik
Routing Information Protocol (RIP) on Mikrotik
 
Connection load balancing with mikrotik [workshop]
Connection load balancing with mikrotik [workshop]Connection load balancing with mikrotik [workshop]
Connection load balancing with mikrotik [workshop]
 
VPN on Mikrotik
VPN on MikrotikVPN on Mikrotik
VPN on Mikrotik
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 

Mikrotik API

  • 1. www.glcnetworks.com API (Application Programming Interface) GLC webinar, 29 December 2016 Achmad Mardiansyah achmad@glcnetworks.com GLC Networks, Indonesia
  • 2. www.glcnetworks.com Agenda ● Introduction ● API intro ● Mikrotik API ● Demo ● Q & A 2
  • 3. www.glcnetworks.com What is GLC? ● Garda Lintas Cakrawala (www.glcnetworks.com) ● An Indonesian company ● Located in Bandung ● Areas: Training, IT Consulting ● Mikrotik Certified Training Partner ● Mikrotik Certified Consultant ● Mikrotik distributor 3
  • 4. www.glcnetworks.com About GLC webinar? ● First webinar: january 1, 2010 (title: tahun baru bersama solaris - new year with solaris OS) ● As a sharing event with various topics: linux, networking, wireless, database, programming, etc ● Regular schedule: every 2 weeks ● Irregular schedule: as needed ● Checking schedule: http://www.glcnetworks.com/main/sc hedule ● You are invited to be a presenter ○ No need to be an expert ○ This is a forum for sharing: knowledge, experiences, information 4
  • 5. www.glcnetworks.com Trainer Introduction ● Name: Achmad Mardiansyah ● Base: bandung, Indonesia ● Linux user since 1999 ● Mikrotik user since 2007 ● Certified Trainer (MTCNA/RE/WE/UME/INE/TCE) ● Mikrotik Certified Consultant ● Work: Telco engineer, Sysadmin, PHP programmer, and Lecturer ● Personal website: http://achmadjournal.com ● More info: http://au.linkedin.com/in/achmadmardiansyah 5
  • 6. www.glcnetworks.com Please introduce yourself ● Your name ● Your company/university? ● Your networking experience? ● Your mikrotik experience? ● Your expectation from this course? 6
  • 7. www.glcnetworks.com What is Mikrotik? ● Name of a company ● A brand ● A program (e.g. mikrotik academy) ● Headquarter: Riga, Latvia 7
  • 8. www.glcnetworks.com What are mikrotik products? ● Router OS ○ The OS. Specialized for networking ○ Website: www.mikrotik.com/download ● RouterBoard ○ The hardware ○ RouterOS installed ○ Website: www.routerboard.com 8
  • 9. www.glcnetworks.com What Router OS can do? ● Go to www.mikrotik.com ○ Download: what_is_routeros.pdf ○ Download: product catalog ○ Download: newsletter 9
  • 10. www.glcnetworks.com What are Mikrotik training & certifications? 10 Certificate validity is 3 years
  • 12. www.glcnetworks.com What is API? ● API: Application Programming Interface ● a set of subroutine definitions, protocols, and tools for building application software. ● defined methods of communication between various software components ● API implementation are varied: ○ web-based system - using HTTP (popular) ○ operating system based - e.g. when developing daemon (apache, nginx) ○ Hardware based - e.g. when accessing microcontroller ○ etc.. 12
  • 13. www.glcnetworks.com Why use API? ● For machine to machine communication (e.g. exchange rate, provisioning, single sign on, etc) ● For automation (e.g. facebook login, twitter login, etc) ● To develop advanced services (uber, gojek, etc. they use google map API) ● For security. Limitation of access rights ● Many other reasons... 13
  • 15. www.glcnetworks.com Mikrotik API ● Available since version 3 ● Running on TCP port 8728 (http), or TCP port 8729 (https) ● API service is disabled by default ● API is intended for machines, not human 15 Without API With API
  • 16. www.glcnetworks.com Why use Mikrotik API? ● Security: define more fine-grained security, indirect access to the devices ● Provisioning: add/delete/update user ● Monitoring ● Customised access for user ● Develop a new service (fb login, single-sign-on, etc) ● Communicate with external application (e.g. billing system, monitoring, self-service application) ● API is more rigid and consistent (suitable for machines). Unlike ssh (ssh is for human interface) ● etc... 1616 Accessing mikrotik API
  • 17. www.glcnetworks.com How to access mikrotik API? ● You need to understand programming language. E.g. PHP ● You need to provide a middle server that connects to mikrotik devices ● Make sure no firewall is blocking the mikrotik API ● API service need to be activated ● Make sure the user has api privileges ● Tips: only allow specific IP address that can access mikrotik API 17
  • 19. www.glcnetworks.com Using Mikrotik API In this example we will use: ● PHP programming language ● Mikrotik PHP class by BenMenking (https://github.com/BenMenking/routeros-api) ● A webserver that can access mikrotik devices 191919 Accessing mikrotik API
  • 20. www.glcnetworks.com Example script (setup initial connection) require('routeros_api.class.php'); //include api class define('MIKROTIK_IP', '192.168.88.1'); //mikrotikIP address define('MIKROTIK_USERNAME', 'admin'); //mikrotik username define('MIKROTIK_PASSWORD', 'secret'); //mikrotik password $API = new routeros_api(); //create a new instance $API->debug = true; //activate debug $API->connect(MIKROTIK_IP, MIKROTIK_USERNAME, MIKROTIK_PASSWORD); // connect to mikrotik device 20
  • 21. www.glcnetworks.com add hotspot user using API (prepare user) $user = array(1 => array('name' => 'user1', 'password' => 'pass1'), 2 => array('name' => 'user2', 'password' => 'pass2'), 3 => array('name' => 'user3', 'password' => 'pass3'), 4 => array('name' => 'user4', 'password' => 'pass4'), 5 => array('name' => 'user5', 'password' => 'pass5'), ); foreach($user as $tmp) { $username="=name="; $username.=$tmp['name']; $pass="=password="; $pass.=$tmp['password']; $server="=server="; $server.=SERVER;$profile="=profile="; $profile.=PROFILE; 21
  • 22. www.glcnetworks.com add hotspot user using API (add user) $API->write('/ip/hotspot/user/add',false); //execute add command $API->write($username, false); //insert username $API->write($pass, false); // insert password $API->write($server, false); //insert server $API->write($profile); //insert profile name $ARRAY = $API->read(); // this is for debug echo "<pre>"; print_r($ARRAY); echo "</pre>"; } $API->disconnect(); //disconnect API 22
  • 23. www.glcnetworks.com Interested? Just come to our training... Special price for webinar attendees... 23
  • 24. www.glcnetworks.com End of slides ● Thank you for your attention ● Please submit your feedback: http://bit.ly/glcfeedback ● Like our facebook page: “GLC networks” ● Stay tune with our schedule 24