Community discussions

MikroTik App
 
bes
just joined
Topic Author
Posts: 20
Joined: Fri Feb 24, 2006 10:01 pm

2 WAN to 1 LAN

Sun Mar 19, 2006 7:16 pm

Hi i hawe two ISP.
WAN1 and WAN2
How can i do p2p programms come WAN1,and all others come WAN2.
I try to make on example from mikrotik.com
I match all others connections and write route rule,but it did not work.
 
User avatar
savagedavid
Trainer
Trainer
Posts: 310
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Mon Mar 20, 2006 12:58 am

please give us the example of how you setup the rules
 
bes
just joined
Topic Author
Posts: 20
Joined: Fri Feb 24, 2006 10:01 pm

Tue Mar 21, 2006 10:39 pm

match all trafic
36 chain=prerouting action=mark-routing new-routing-mark=all passthrough=yes
And adding route:
0.0.0.0/0 r 82.135.202.1 1 WAN2 witch routing mark all
this route not work,then i matching example port 80 route works good.

And this example is from mikrotik.com

Notes
You can use policy routing even if you use masquerading on your private networks. The source address will be the same as it is in the local network. In previous versions of RouterOS the source address changed to 0.0.0.0

It is impossible to recognize peer-to-peer traffic from the first packet. Only already established connections can be matched. That also means that in case source NAT is treating Peer-to-Peer traffic differently from the regular traffic, Peer-to-Peer programs will not work (general application is policy-routing redirecting regular traffic through one interface and Peer-to-Peer traffic - through another). A known workaround for this problem is to solve it from the other side: making not Peer-to-Peer traffic to go through another gateway, but all other useful traffic go through another gateway. In other words, to specify what protocols (HTTP, DNS, POP3, etc.) will go through the gateway A, leaving all the rest (so Peer-to-Peer traffic also) to use the gateway B (it is not important, which gateway is which; it is only important to keep Peer-to-Peer together with all traffic except the specified protocols)

Example
To add the rule specifying that all the packets from the 10.0.0.144 host should lookup the mt routing table:

[admin@MikroTik] ip firewall mangle add action=mark-routing new-routing-mark=mt \
\... chain=prerouting
[admin@MikroTik] ip route> add gateway=10.0.0.254 routing-mark=mt
[admin@MikroTik] ip route rule> add src-address=10.0.0.144/32 \
\... table=mt action=lookup
[admin@MikroTik] ip route rule> print
Flags: X - disabled, I - invalid
0 src-address=192.168.0.144/32 action=lookup table=mt
[admin@MikroTik] ip route rule>
please give us the example of how you setup the rules
 
User avatar
savagedavid
Trainer
Trainer
Posts: 310
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Wed Mar 22, 2006 8:48 am

in order to do this this you first have to match all-p2p and then match the rest of the traffic with your routing marks. Then you need a routing table for the p2p traffic. you can then direct p2p along the alternate route and keep normal traffic on the default route.

Your example matches all traffic, so the system cannot differentiate which is p2p without a specific mangle for it.
 
bes
just joined
Topic Author
Posts: 20
Joined: Fri Feb 24, 2006 10:01 pm

Wed Mar 22, 2006 8:45 pm

If p2p trafig goes by default route(not matched by firewall/mangle) interface WAN1.
Whats ports i must mach and routing by policy route when all others trafic coming WAN2?
 
User avatar
savagedavid
Trainer
Trainer
Posts: 310
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Wed Mar 22, 2006 10:46 pm

You have to match p2p to something so that the router can distinguish, even if it goes out the default route. It is easy to match p2p and then assign to default route and then assume all other traffic that is not p2p must go through alternate route. It would not be easy to do the other way around
 
bes
just joined
Topic Author
Posts: 20
Joined: Fri Feb 24, 2006 10:01 pm

Thu Mar 23, 2006 10:25 am

when i match routing mark p2p trafic and add route rule p2p programs not works.
And when i match other ports, example 80 or 25 route rule works good.

Who is online

Users browsing this forum: alidamji, Bing [Bot], Google [Bot], ingdaka, Majestic-12 [Bot] and 74 guests