I'm have 2 WANs and 3 LANs
WAN1: 10.1.1.1/24 ISP1
WAN2: 10.2.2.2/24 ISP2
LAN1: 192.168.50.0/16 Users computers
LAN2: 192.168.1.0/24 Server Web/SSH
LAN3: 192.168.100.0/24 (Asterisk and IP Phones)
My objective to finish my setup are focused on Firewall rules (Mangel and NAT)
redirect incoming traffic in wan1 and wan2 to the local server
Code: Select all
/ip firewall nat add chain=dstnat protocol=tcp dst-port=2222 in-interface=WAN1 action=dst-nat to-addresses=192.168.1.10 to-ports=22
/ip firewall nat add chain=dstnat protocol=tcp dst-port=2222 in-interface=WAN2 action=dst-nat to-addresses=192.168.1.10 to-ports=22
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 in-interface=WAN1 action=dst-nat to-addresses=192.168.1.10 to-ports=80
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 in-interface=WAN2 action=dst-nat to-addresses=192.168.1.10 to-ports=80
/ip firewall nat add chain=dstnat protocol=udp dst-port=5060-5061 in-interface=WAN2 action=dst-nat to-addresses=192.168.100.100 to-ports=5060-5061
Code: Select all
/ip firewall mangle add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=WAN1_connection passthrough=yes disabled=no comment="in wan1,out wan1"
/ip firewall mangle add action=mark-routing chain=output connection-mark=WAN1_connection new-routing-mark=to_WAN1 passthrough=no disabled=no comment="in wan1,out wan1"
Code: Select all
/ip firewall mangle add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=WAN2_connection passthrough=yes disabled=no comment="in wan2,out wan2"
/ip firewall mangle add action=mark-routing chain=output connection-mark=WAN2_connection new-routing-mark=to_WAN2 passthrough=no disabled=no comment="in wan2,out wan2"
Code: Select all
/ip firewall mangle add action=mark-connection chain=forward in-interface=WAN1 connection-state=new new-connection-mark=WAN1_pfw passthrough=no disabled=no comment="pfw wan1, out wan1"
/ip firewall mangle add action=mark-routing chain=prerouting in-interface-list=LANs connection-mark=WAN1_pfw new-routing-mark=to_WAN1 passthrough=no disabled=no comment="pfw wan1, out wan1"
Code: Select all
/ip firewall mangle add action=mark-connection chain=forward in-interface=WAN2 connection-state=new new-connection-mark=WAN2_pfw passthrough=no disabled=no comment="pfw wan2, out wan2"
/ip firewall mangle add action=mark-routing chain=prerouting in-interface-list=LANs connection-mark=WAN2_pfw new-routing-mark=to_WAN2 passthrough=no disabled=no comment="pfw wan2, out wan2"
Code: Select all
/ip route add dst-address=0.0.0.0/0 gateway=WAN1 distance=1 routing-mark=to_WAN1 disabled=no
/ip route add dst-address=0.0.0.0/0 gateway=WAN2 distance=1 routing-mark=to_WAN2 disabled=no
/ip route add dst-address=0.0.0.0/0 gateway=WAN1 distance=1 disabled=no
/ip route add dst-address=0.0.0.0/0 gateway=WAN2 distance=2 disabled=no
PROBLEMS
# Remote connections to web server going fine
# SSH connections have some troubles, sniffing the traffic see the follow extrange things, the connections are take a lot of time to complete the connection from WAN2, inclusive for WAN1 in some cases
Code: Select all
TCP 125 [TCP Dup ACK 2121#1] 22 → 34577 [ACK] Seq=1 Ack=49 Win=173 Len=0 TSval=187060543 TSecr=8649041 SLE=97 SRE=145
TCP 113 [TCP Retransmission] 22 → 59824 [FIN, ACK] Seq=2593 Ack=2514 Win=196 Len=0 TSval=187080587 TSecr=8649921
The Firewall -> service ports -> SIP is disabled
OBJETIVES
1- Good natting for ssh and web services, in:WAN1/out:WAN1 and in:WAN2/out:WAN2
2- Load balance of outgoing connections of LAN1 to take advantage of my two FO connections
3- The LAN3 Voip server and sip-phones ever outgoinn/incoming from WAN2
Thanks for all help than can give to me.