(20250210) Started working on MikroTik config automation.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# MiktoTik Configuration Steps
|
||||
### We need to configure MikroTik servers for two end use cases - PPPoE or Hotspot. here are the steps to achieve them through MikroTik's REST API facility. Use the `MiktoTik (EasyFi)` Postman collection for this.
|
||||
#### Author: Khushal
|
||||
#### Date: 20250210
|
||||
#### 20250210 / Khushal P S
|
||||
We need to configure MikroTik servers for the end use case of "PPPoE"Here are the steps to achieve it through MikroTik's
|
||||
REST API facility. Use the `MiktoTik (EasyFi)` Postman collection for this.
|
||||
|
||||
---
|
||||
|
||||
## General Notes:
|
||||
## Before We Begin
|
||||
|
||||
MikroTik allows access via REST API using Basic-Auth headers which take a `username` and a `password`. The base path
|
||||
would look something like `http://<ip-addr>/rest`. You may need to mention a port no. if the default has been changed.
|
||||
@@ -23,7 +23,50 @@ is an actual physical connectivity interface (typically ethernet) on the MikroTi
|
||||
- Select the first one that has field `"running"` set to `"false"`, and pick its `".id"` value.
|
||||
- Rename it to `"easyfi-pppoe"` by its `".id"` on the `/interface/<.id>` path using `PATCH` method.
|
||||
|
||||
**NOTE:** Remember to save the original configuration in the `comment` field (as a JSON string) in case a roll-back is
|
||||
needed.
|
||||
**ROLL-BACK:** Save the original configuration as a JSON string in the `comment` field.
|
||||
|
||||
### 2. Create VLAN Interfaces
|
||||
|
||||
You will be given a range of VLAN interfaces like `"2001-2010"`. Create on VLAN for each id such that the value of the
|
||||
name of the `"interface"` that you set for it is set to `"easyfi-pppoe"` (the name of the physical interface).
|
||||
|
||||
Use `PUT` method on the path `/interface/vlan`. Consider to the following example JSON:
|
||||
```json
|
||||
{
|
||||
"name": "easyfi-vlan-2001",
|
||||
"interface": "easyfi-pppoe",
|
||||
"vlan-id": "2001",
|
||||
"disabled": "false",
|
||||
"comment": "easyfi"
|
||||
}
|
||||
```
|
||||
|
||||
**NOTE:** Looping needed.
|
||||
|
||||
**ROLL-BACK:** Save the original configuration as a JSON string in the `comment` field. If there was no original
|
||||
configuration, simply delete your record.
|
||||
|
||||
### 3. Assign Private IP Subnets to the VLANs
|
||||
|
||||
You will receive the Private IP range in either CIDR notation or as a hyphen-separated string.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### 2.
|
||||
@@ -1,6 +1,6 @@
|
||||
# MiktoTik Configuration Steps
|
||||
### We need to configure MikroTik servers for two end use cases - PPPoE or HotSpot. here are the steps to achieve them through MikroTik's REST API facility. Use the `MiktoTik (EasyFi)` Postman collection for this.
|
||||
#### Authors: Bhushan, Hari, Khushal
|
||||
#### Authors: Bhushan, Hari
|
||||
#### Date: 20250209
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user