EvilFreelancer / docker-routeros

Mikrotik RouterOS inside Docker container
https://hub.docker.com/r/evilfreelancer/docker-routeros/
MIT License
356 stars 127 forks source link

problem other ports #3

Closed vaheed closed 4 years ago

vaheed commented 4 years ago

hello and thanks for a good job

but I try many more and only MikroTik IP Service works behind docker and other services like VPNs and speedtest and etc.. not work!

in this case, I can connect with winbox and web but I can't start speedtest or any type of VPNs, I try to input router logs everything, but no traffic incoming the router!

output traffic it's ok, but input nothing.

docker run --privileged --name CHR -d -p 2000:2000/udp -p 8291:8291 -p 1701:1701 -p 1701:1701/udp -p 1723:1723 -p 1723:1723/udp -p 500:500/udp -p 4500:4500/udp -p 50:50 -p 50:50/udp -p 51:51 -p 51:51/udp -p 8998:80 -p 47:47 -ti evilfreelancer/docker-routeros:6.46.4

can you tell me my wrong !?

EvilFreelancer commented 4 years ago

Hello! Ports which you set via docker keys also should be in your custom entrypoint.

Couple examples: https://github.com/EvilFreelancer/docker-routeros/blob/master/entrypoint.sh https://github.com/EvilFreelancer/docker-routeros/blob/master/entrypoint_with_four_interfaces.sh

You need to create new one, with list of ports which you need then pass this file to docker container and overwrite /entrypoint.sh file

vaheed commented 4 years ago

Yup and thanks for the reply,

now I received packet form client but VPN not connected and the problem with GRE protocol now, how can passthrough GRE protocol to the container?

gre

this is the example of my build

-netdev user,id=net0,hostfwd=tcp::21-:21,hostfwd=tcp::22-:22,hostfwd=tcp::23-:23,hostfwd=tcp::80-:80,hostfwd=tcp::443-:443,hostfwd=tcp::8291-:8291,hostfwd=tcp::8728-:8728,hostfwd=tcp::8729-:8729,hostfwd=udp::2000-:2000,hostfwd=tcp::1701-:1701,hostfwd=tcp::1723-:1723,hostfwd=udp::500-:500,hostfwd=udp::4500-:4500,hostfwd=tcp::50-:50,hostfwd=tcp::51-:51,hostfwd=tcp::47-:47

I know 47 (GRE) is a protocol and not a TCP or UDP port number, but I don't know how can pass to the container and google not help!

EvilFreelancer commented 4 years ago

GRE is UDP, so you need to set UDP forwarding for your port https://en.wikipedia.org/wiki/Generic_Routing_Encapsulation

EvilFreelancer commented 4 years ago

Hope you've got what i've meant just replace hostfwd=tcp::47-:47 to hostfwd=udp::47-:47 :)

vaheed commented 4 years ago

thanks but not help, I think MikroTik cant behind the nat support VPNs like PPTP or l2tp, I try many ways, but all time VPN cant connect.

if you found a way how can passthrough, I hope to share it.

EvilFreelancer commented 4 years ago

Hello! Issue solved, I've added bridge mode of network, now this image will work as container by VR Lab, just check readme and use image at least evilfreelancer/docker-routeros:6.46.5