Hello everyone
may be you can help me in order to understand how mangle works on ROS 7.
I need to forward traffic from 2 internal hosts to a specific public IP (A.B.C.D) via VPN instead of internet.
So I created a new route table “verso_VPN” and some mangle rules:
/ip firewall mangle
add action=mark-connection chain=input comment=“pacchetti da VPN devono uscire con VPN” in-interface=l2tp-padova new-connection-mark=Connessione_VPN passthrough=no
add action=mark-routing chain=output comment=“Pacchetti per VPN” connection-mark=Connessione_VPN new-routing-mark=verso_VPN passthrough=yes
add action=mark-connection chain=forward connection-mark=no-mark in-interface=l2tp-padova new-connection-mark=DA_VPN_A_LAN passthrough=yes
add action=mark-routing chain=prerouting connection-mark=DA_VPN_A_LAN new-routing-mark=verso_VPN passthrough=yes src-address-list=GRUPPO_DISPOSITIVI_VOIP
I created
/ip firewall address-list
add address=192.168.1.65 comment=“Gateway 2N” list=GRUPPO_DISPOSITIVI_VOIP
add address=192.168.1.150 comment=“Gateway Patton” list=GRUPPO_DISPOSITIVI_VOIP
/ip route
add check-gateway=ping destination=A.B.C.D/32 comment=“Rotte in transito VPN” distance=1 gateway=l2tp-padova routing-mark=verso_VPN
Traffic to A.B.C.D is still going out from default route 0.0.0.0/0 instead of this specific one.
It seems that route is ignoring the routing table.
If I set
/ip route
add check-gateway=ping destination=A.B.C.D/32 comment=“Rotte in transito VPN” distance=1 gateway=l2tp-padova
packets are forwarded via VPN.
My need is to limit that behaviour only to specific internal LAN hosts.
Thank you