Difference between revisions of "Upload wan download another"
(→Upload though WAN1 download through another WAN) |
NetworkPro (talk | contribs) (Nice to know. I'm doing this for some time.) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | ==== Upload though WAN1 download through another WAN ==== | + | ==== Upload though WAN1, download through another WAN ==== |
− | + | ||
− | Supouse you have | + | Supouse you have |
− | '''WAN1''' (WAN-DOWN) ADSL with 10Mbps down / 512K Up | + | '''WAN1''' (WAN-DOWN) ADSL with 10Mbps down / 512K Up |
− | '''WAN2''' (WAN-UPDOWN) Dedicated Line 5Mbps down / 5Mbps up | + | '''WAN2''' (WAN-UPDOWN) Dedicated Line 5Mbps down / 5Mbps up |
− | + | ||
− | I'll explain how to | + | I'll explain how to route WAN1's upload packets through WAN2 |
We need that mikrotik has 2 ''public IP, one for each WAN' | We need that mikrotik has 2 ''public IP, one for each WAN' | ||
Line 11: | Line 11: | ||
Supose WAN-UPDOWN gateway is 190....254 ; Its our "upload gateway" | Supose WAN-UPDOWN gateway is 190....254 ; Its our "upload gateway" | ||
− | 1) We will do mangle "download" | + | 1) We will do mangle "download" connections route through WAN-DOWN |
/ip firewall mangle | /ip firewall mangle | ||
− | add action=mark-routing chain=prerouting comment=" | + | 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. | Note passthrough=yes dont change it. | ||
2) Then we route-mark ESTABLISHED wandown_route packets and send to WAN2's Gateway | 2) Then we route-mark ESTABLISHED wandown_route packets and send to WAN2's Gateway | ||
− | add action=mark-routing chain=prerouting | + | add action=mark-routing chain=prerouting \ |
− | connection-state=established | + | connection-state=established new-routing-mark=wanup_route \ |
passthrough=yes routing-mark=wandown_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. | 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: | 3) Now, we finish with routes: | ||
/ip routes | /ip routes | ||
− | add comment="Gateway UPLOAD" | + | add comment="Gateway UPLOAD" distance=1 dst-address=0.0.0.0/0 \ |
− | 190....254 routing-mark=wanup_route | + | gateway=190....254 routing-mark=wanup_route |
− | add comment="Gateway Download (UPLOAD FALSO)" | + | add comment="Gateway Download (UPLOAD FALSO)" distance=1 dst-address=0.0.0.0/0 \ |
− | 200....1 routing-mark=wandown_route | + | gateway=200....1 routing-mark=wandown_route |
− | |||
− | This | + | 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. | + | 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. | I'm sorry for my english, please correct all errors. |
Latest revision as of 20:57, 19 May 2010
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.