Closed reinethernal closed 5 years ago
Hello!
Yep, you may use docker-compose config, for example:
version: "3"
services:
routeros-6-42:
image: evilfreelancer/docker-routeros:6.42.12
restart: unless-stopped
ports:
- "12222:22"
- "12223:23"
- "18728:8728"
- "18729:8729"
....list of additional ports....
Or pure docker way via -p key with list of ports
docker run -d -p 2222:22 -p 8728:8728 -p 8729:8729 -p 5900:5900 -ti evilfreelancer/docker-routeros
First number is port of your host machine, second is internal container port, via iptable both these ports will be communicated
Oh, sorry for the inaccuracy. I meant adding network interfaces, like ethernet 2, etc to be available at ROS.
Hm, I think this is not possible for current solution, because docker container has only one erhernet adapter by default (mean eth0, you can login to container and print all available interfaces).
Probably you may use network_mode: "host"
in docker compose config and container will see all available interfaces, then need to modify entrypoint.sh
file and add required interfaces.
Could you please tell me login and entry point /bin/sh or /bin/bash? and credentials would be helpfull too)
docker-compose exec routeros-6-42 bash
or
docker-compose exec routeros-6-42 sh
by default ROS has no password, you can login via telnet as admin user
Thx, i'll try)
I tried to add some interfaces, but get stuck. I have an idea to add several bridgesm because host network has only one interface. Is it possible?
Yeah, you can add few networks to docker container (networks also mean network interfaces), probably best solution for this is rewriting entrypoint and docker compose file.
I've tried to create few intefaces for qemu inside docker container, but seems it's not so easy as I expected. My second idea is VDE switch http://wiki.virtualsquare.org/wiki/index.php/VDE_Basic_Networking and connect qemu to docker interfaces via this switch, because I've checked TAP tunnels and seems it's not work.
I reached my goal by adding following lines to the entrypoint.sh
-device e1000,netdev=net1 \ -netdev user,id=net1 \ -device e1000,netdev=net2 \ -netdev user,id=net2 \ -device e1000,netdev=net3 \ -netdev user,id=net3
.
tried to add more, but startup take too long. idk hy so, but 4 interfaces is more than enough for me. Thank you for help. Issue can be closed)
So you just was needed few interfaces which not actually work? (Probably by test reasons) Because your solution looks like "just create few interfaces which not connected to external network" Or it's really working with external network??? :)
Yes, but then i connected them to additional bridges
Can you please provide complete solution? (maybe via gist or somehow else) I'll add it to this repo as alternative edition of docker image, because for right now this container is for test purposes only.
I've added yet another entrypoint by your gist
https://github.com/EvilFreelancer/docker-routeros/blob/master/entrypoint_with_four_interfaces.sh
All next releases will be with this file (you already may use image with latest
tag)
For use this you just will need set another entrypoint via your docker-compose file
Is there any way to add ethernet ports to ROS in this container?