2018-08-22 15:59:29 +03:00
|
|
|
# Mikrotik RouterOS in Docker
|
|
|
|
|
2018-08-23 18:09:23 +03:00
|
|
|
This extrasmall image was created for tests purpose only, for example on
|
|
|
|
this project based unit testing of [routeros-api-php](https://github.com/EvilFreelancer/routeros-api-php) library.
|
|
|
|
If you need fully functional "RouterOS in Docker" for production usage
|
|
|
|
look at [VR Network Lab](https://github.com/plajjan/vrnetlab) project.
|
|
|
|
|
2018-08-22 15:59:29 +03:00
|
|
|
## How to use
|
|
|
|
|
2018-08-23 18:09:23 +03:00
|
|
|
### Create your own `Dockerfile`
|
|
|
|
|
2018-08-23 18:09:45 +03:00
|
|
|
List of all available tags is [here](https://hub.docker.com/r/evilfreelancer/docker-routeros/tags/),
|
2018-08-23 18:09:23 +03:00
|
|
|
`latest` will be used by default.
|
|
|
|
|
|
|
|
```dockerfile
|
|
|
|
FROM evilfreelancer/docker-routeros
|
|
|
|
ADD ["your-scripts.sh", "/"]
|
|
|
|
RUN /your-scripts.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
### Use image from docker hub
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker pull evilfreelancer/docker-routeros
|
2019-02-05 22:04:05 +03:00
|
|
|
docker run -d -p 2222:22 -p 8728:8728 -p 8729:8729 -p 5900:5900 -ti evilfreelancer/docker-routeros
|
2018-08-23 18:09:23 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Use in docker-compose.yml
|
|
|
|
|
2019-01-11 17:24:19 +03:00
|
|
|
Example is [here](docker-compose.yml).
|
|
|
|
|
2018-08-23 18:09:23 +03:00
|
|
|
```yml
|
2019-01-11 17:24:19 +03:00
|
|
|
version: "3"
|
2018-08-22 15:59:29 +03:00
|
|
|
|
2018-08-23 18:09:23 +03:00
|
|
|
services:
|
2018-08-22 15:59:29 +03:00
|
|
|
|
2019-01-11 17:24:19 +03:00
|
|
|
routeros-6-42:
|
2019-03-02 03:13:22 +03:00
|
|
|
image: evilfreelancer/docker-routeros:6.42.12
|
2018-08-23 18:09:23 +03:00
|
|
|
restart: unless-stopped
|
|
|
|
ports:
|
2019-01-11 17:24:19 +03:00
|
|
|
- "12222:22"
|
|
|
|
- "12223:23"
|
|
|
|
- "18728:8728"
|
|
|
|
- "18729:8729"
|
2018-08-23 18:09:23 +03:00
|
|
|
|
2019-03-02 03:13:22 +03:00
|
|
|
routeros-6-44:
|
|
|
|
image: evilfreelancer/docker-routeros:6.44
|
2018-08-23 18:09:23 +03:00
|
|
|
restart: unless-stopped
|
|
|
|
ports:
|
2019-01-11 17:24:19 +03:00
|
|
|
- "22222:22"
|
2019-02-05 22:04:05 +03:00
|
|
|
- "22223:23"
|
2019-01-11 17:24:19 +03:00
|
|
|
- "28728:8728"
|
|
|
|
- "28729:8729"
|
|
|
|
|
2018-08-23 18:09:23 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Build from sources
|
|
|
|
|
|
|
|
For this you need download project and build everything from scratch:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/EvilFreelancer/docker-routeros.git
|
|
|
|
cd docker-routeros
|
|
|
|
docker build . --tag ros
|
2019-02-05 22:04:05 +03:00
|
|
|
docker run -d -p 2222:22 -p 8728:8728 -p 8729:8729 -p 5900:5900 -ti ros
|
2018-08-23 18:09:23 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Now you can connect to your RouterOS container via VNC protocol
|
2019-02-05 22:04:05 +03:00
|
|
|
(on localhost 5900 port) and via SSH (on localhost 2222 port).
|
2018-08-23 18:09:23 +03:00
|
|
|
|
|
|
|
## List of exposed ports
|
|
|
|
|
|
|
|
For access via VNC: 5900
|
|
|
|
|
|
|
|
Default ports of RouterOS: 21, 22, 23, 80, 443, 8291, 8728, 8729
|
2019-02-05 22:04:05 +03:00
|
|
|
|
|
|
|
IPSec: 50, 51, 500, 4500
|
|
|
|
|
|
|
|
OpenVPN: 1194
|
|
|
|
|
|
|
|
L2TP: 1701
|
|
|
|
|
|
|
|
PPTP: 1723
|