Page 1 of 1

2wans via rb951g,, not work,, this's code:

Posted: Mon May 19, 2014 3:20 am
by anas3009
/ip firewall mangle
add action=mark-connection chain=input in-interface=ether1-WAN1 new-connection-mark=WAN1_conn
add action=mark-connection chain=input in-interface=ether2-WAN2 new-connection-mark=WAN2_conn
add action=mark-routing chain=output connection-mark=WAN1_conn new-routing-mark= to_WAN1
add action=mark-routing chain=output connection-mark=WAN2_conn new-routing-mark= to_WAN2
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=\
    bridge-local new-connection-mark=WAN1_conn per-connection-classifier= both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=\
    bridge-local new-connection-mark=WAN2_conn per-connection-classifier= both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=bridge-local new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=bridge-local new-routing-mark=to_WAN2

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-WAN1 to-addresses=0.0.0.0
add action=masquerade chain=srcnat out-interface=ether2-WAN2 to-addresses=0.0.0.0

/ip route
add check-gateway=ping distance=1 gateway=ether1-WAN1 routing-mark=to_WAN1
add check-gateway=ping distance=2 gateway=ether2-WAN2 routing-mark=to_WAN2

/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid interface=ether1-WAN1
add default-route-distance=1 dhcp-options=hostname,clientid interface=ether2-WAN2
I have 2 wan (first 20mb and the other 4mb),, any way,, the main problem that one of them is very bad and most of the time not online (up)
how to solve this??
and each one have a different DNS !!

I tried a lot of codes and tried to read and understand them.. but it's a little bit hard :( Is there an easy way to understand what's the main idea of how PCC works!

sorry for my English :)

Re: 2wans via rb951g,, not work,, this's code:

Posted: Wed May 21, 2014 2:21 am
by Farhadgh
You have mistakes in marking connections and recognizing wans to Mikrotik. also input chains are obviously wrong.

Re: 2wans via rb951g,, not work,, this's code:

Posted: Wed May 21, 2014 2:26 am
by anas3009
Where should i start?

Re: 2wans via rb951g,, not work,, this's code:

Posted: Wed May 21, 2014 9:00 am
by bingo220
You have very different connections.
I would use a failover method, not a loadbanacing.
http://forum.mikrotik.com/viewtopic.php ... 20#p427103

Re: 2wans via rb951g,, not work,, this's code:

Posted: Wed May 21, 2014 11:09 am
by Farhadgh
you should just mark packets with destinations of 0.0.0.0/0 (with prerouting chain), then mark their connection, and then mark their routing.
you can differ users route by their src-addresses, or destinations, or interfaces, or ... or you can route them from main ISP and set second route's distance higher than main route.
Any questions are welcomed.
If it was helpful, don't forget donating a karma ;)