Hi everyone, inherited a “hAP AC lite” Mikrotik device, internet is working on it through some PPTP tunnel which was configured before me, now I have a task to configure - when a device is connected to certain port (let’s say ether3) it should use alternate gateway.
Now -
Server ->>> port ether5------>>>Mikrotik with lte1 Modem connected to its USB port with data plan on it from ISP1—>>>PPTP tunnel to another ISP2 (so the actual tunnel is used only to reach ISP2 core and then to Internet, so the device connected to ether5 is having external IP from ISP2 ) --.>> Internet access (this is already working fine)
Need to add -
Server2 ->>> port ether3------>>>^^^Mikrotik with lte1 Modem connected to its USB port with data plan on it from ISP1^^^->>> internet access from ISP1 (thus through this USB stick)
What I’ve done -
- Added IP address to ether3 and assigned 172.16.0.2/24 to a PC connected to ether3 interface
/ip address
add address=172.16.0.1/24 interface=ether3 network=172.16.0.0
/ip firewall mangle
add action=mark-routing chain=prerouting log=yes new-routing-mark=USB_STICK passthrough=yes src-address=172.16.0.0/24
NAT
/ip firewall nat
add action=masquerade chain=srcnat dst-address=0.0.0.0 src-address=172.16.0.0/24
Added route
/ip route
add distance=1 gateway=lte1 routing-mark=USB_STICK
5) misc.
/interface list member
add interface=lte1 list=discover
add interface=ether3 list=discover
In short -
Need to implement separate routing for a device connected to certain interface. And as I understand, this can be done with help of Policy Based Routing, namely - mark packets with routing mark and then create new static route which intercepts those and forwards them to the specified interface (lte1, in my case). Not sure why its still not working(timeouts), can you guys please direct me?
Greatly appreciated!