Upload wan download another

From MikroTik Wiki
Jump to: navigation, search

Upload though WAN1, download through another WAN

Supouse you have WAN1 (WAN-DOWN) ADSL with 10Mbps down / 512K Up WAN2 (WAN-UPDOWN) Dedicated Line 5Mbps down / 5Mbps up

I'll explain how to route WAN1's upload packets through WAN2

We need that mikrotik has 2 public IP, one for each WAN' 'Supose WAN-DOWN gateway is 200....1 ; it's our "download gateway" Supose WAN-UPDOWN gateway is 190....254 ; Its our "upload gateway"

1) We will do mangle "download" connections route through WAN-DOWN

/ip firewall mangle add action=mark-routing chain=prerouting comment="Route WAN-DOWN" \

   new-routing-mark=wandown_route passthrough=yes 

It can be what we need, some IPs (source address list) or some ports TCP 1-1000 for example. Note passthrough=yes dont change it.

2) Then we route-mark ESTABLISHED wandown_route packets and send to WAN2's Gateway

add action=mark-routing chain=prerouting \

   connection-state=established new-routing-mark=wanup_route \
   passthrough=yes routing-mark=wandown_route

Whit that, the connection its negotiated through WAN1 Gateway's, but at the time to upload data packets, we send over the other gateway with WAN1 IP and WAN2 upload speed. Note: This method may not work, if your second provider does not allow packets with spoofed/different source address.

3) Now, we finish with routes:

/ip routes add comment="Gateway UPLOAD" distance=1 dst-address=0.0.0.0/0 \

   gateway=190....254 routing-mark=wanup_route 

add comment="Gateway Download (UPLOAD FALSO)" distance=1 dst-address=0.0.0.0/0 \

   gateway=200....1 routing-mark=wandown_route

This is useful if you had various ADSL and a dedicated line, say bye-bye to its 256K upload rate! Or if you have various adsl, you can "add thogether" all upload rates, ex: 3 ADSL = 780Kbps using nth and this method to achieve the combined speed for a single TCP connection.

I'm sorry for my english, please correct all errors.