Community discussions

MikroTik App
 
anas3009
newbie
Topic Author
Posts: 39
Joined: Sun Feb 16, 2014 1:20 am

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

Mon May 19, 2014 3:20 am

/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 :)
 
User avatar
Farhadgh
just joined
Posts: 19
Joined: Wed Nov 27, 2013 4:38 pm
Contact:

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

Wed May 21, 2014 2:21 am

You have mistakes in marking connections and recognizing wans to Mikrotik. also input chains are obviously wrong.
 
anas3009
newbie
Topic Author
Posts: 39
Joined: Sun Feb 16, 2014 1:20 am

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

Wed May 21, 2014 2:26 am

Where should i start?
 
bingo220
Member Candidate
Member Candidate
Posts: 126
Joined: Sun Sep 22, 2013 9:30 pm
Location: Ukraine

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

Wed May 21, 2014 9:00 am

You have very different connections.
I would use a failover method, not a loadbanacing.
http://forum.mikrotik.com/viewtopic.php ... 20#p427103
 
User avatar
Farhadgh
just joined
Posts: 19
Joined: Wed Nov 27, 2013 4:38 pm
Contact:

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

Wed May 21, 2014 11:09 am

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 ;)