Port Forwading avec Plusieurs Wan
Migration depuis l’ancien wiki MediaWiki
WAN2 : 1.1.1.1 Serveur : 192.168.1.3
- Création des règles pour le routage via le WAN2 qui n'est pas la gateway principale du routeur :
/ip firewall mangle
add action=mark-connection chain=input comment="Mark Connexion IN OUT WAN2" disabled=no in-interface=WAN2 new-connection-mark=wan2_out_conn passthrough=yes
add action=mark-routing chain=output comment="Mark Connexion IN OUT WAN2" connection-mark=wan2_out_conn disabled=no new-routing-mark=wan2_out_traffic passthrough=no
add action=mark-connection chain=forward comment="Mark connexion for fw WAN2" connection-state=new disabled=no in-interface=WAN2 new-connection-mark=wan2_out_pfw passthrough=no
add action=mark-routing chain=prerouting comment="Mark connexion for fw WAN2" connection-mark=wan2_out_pfw in-interface=Lan new-routing-mark=wan2_out_traffic passthrough=no
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=WAN2 routing-mark=wan2_out_traffic scope=30 target-scope=10 comment="Trafic marquage WAN2 OUT"- Creation des règles de fw de ports :
/ip firewall nat
add chain=dstnat action=netmap to-addresses=192.168.1.3 to-ports=21 protocol=tcp dst-address=1.1.1.1 in-interface=WAN2 dst-port=21
add chain=srcnat action=netmap to-addresses=1.1.1.1 to-ports=21 protocol=tcp src-address=192.168.1.3 connection-mark=wan2_out_conn out-interface=WAN2 src-port=21