Enable containers on the router as-per https://help.mikrotik.com/docs/display/ROS/Container
Install container package:
/system/device-mode/update container=yes
. Countdown to reset will begin.193.40.103.10/28
with gateway 193.40.103.1
. Note the /28 - this is to fix BGP based routes to Kubernetes cluster (those IPs will not be in the /28 network, so container will route them via the router). There might be other solutions for this issue aswell. After this vETH gets assigned to the container, the IP will start to show as 0.0.0.0
- the IP will be assigned inside of the container and cannot be changed from this interface anymore. Also, this interface does not allow setting IPv6 address. These are current Mikrotik limitations which might be improved in the future. Command:/interface/veth/add name=openvpn_container_veth address=193.40.103.10/28 gateway=193.40.103.1
VLAN0001_PUB + bridge trunk
port. Set VLAN to 20. Command:/interface/bridge/port add bridge="VLAN0001_PUB + bridge trunk" interface=openvpn_container_veth
https://harbor.k-space.ee
as the image repository and pulling the image from there, but it failed due some manifest error. See some discussion here. This might be fixed at some point but as a workaround, I exported the image on my machine to tar and uploaded it to the root directory using WinBox. Commands:docker pull harbor.k-space.ee/k-space/openvpn
docker save harbor.k-space.ee/k-space/openvpn > openvpn.tar
fetch
tool, which can pull data from HTTP(S), FTP and much more. I named the folder openvpn
./ip/service/set ftp disabled=no
/ip/service/set ftp disabled=yes
/container/mounts/add name=openvpn src=/openvpn dst=/etc/openvpn
/container/add file=openvpn.tar interface=openvpn_container_veth mounts=openvpn cmd="--config /etc/openvpn/openvpn-tcp.conf" logging=yes start-on-boot=yes
/container/start 0
/container/shell 0
and add sysctl parameters and IPv6 address:sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1
ip -6 addr add 2001:bb8:4008:24::1 dev eth0
ip -6 route add ::/0 via fe80::7a2b:cbff:fe52:e6a7 dev eth0
(I just took the router's link local address. This might change and there might be more correct solutions to get the router's address from Route Advertisements)/container/stop 0
/container/start 0
supervisord
or some other process mangaer as the container's entrypoint. Or create a separate container and use separate DNS or some NAT logic.