Community discussions

MikroTik App
 
Yuuki
just joined
Topic Author
Posts: 11
Joined: Fri Jan 17, 2014 3:12 pm

Load Balance PCC issue? Advice needed

Thu May 01, 2014 7:07 pm

I'm trying to load-balance two WAN Lines, Try the MikroTik Wiki no luck... Tried Youtube... also no luck

My Configurations

/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
mac-cookie-timeout=3d
/ip pool
add name=dhcp_pool1 ranges=192.168.3.2-192.168.3.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=DMZ name=dhcp1
/port
set 0 name=serial0
add bridge=DMZ interface=LAN
/ip address
add address=192.168.3.1/24 interface=LAN network=192.168.3.0

/ip firewall address-list
add address=192.168.3.0/24 list=LOCAL

/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no \
interface=ISP2
add add-default-route=no dhcp-options=hostname,clientid disabled=no \
interface=ISP1
/ip dhcp-server network
add address=192.168.3.0/24 dns-server=192.168.3.1 gateway=192.168.3.1
/ip dns
set allow-remote-requests=yes


/ip firewall mangle
add action=mark-connection chain=input connection-mark=no-mark in-interface=\
ISP1 new-connection-mark=ISP1_conn
add action=mark-connection chain=input connection-mark=no-mark in-interface=\
ISP2 new-connection-mark=ISP2_conn
add action=mark-routing chain=output connection-mark=ISP1_conn \
new-routing-mark=to_ISP1
add action=mark-routing chain=output connection-mark=ISP2_conn \
new-routing-mark=to_ISP2

add chain=prerouting comment="Accept LOCAL Addr" dst-address-list=LOCAL
add chain=prerouting dst-address=192.168.3.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.3.0/24 in-interface=LAN

add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=LAN new-connection-mark=ISP1_conn per-connection-classifier=\
src-address:2/0
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=LAN new-connection-mark=ISP2_conn per-connection-classifier=\
src-address:2/1

add action=mark-routing chain=prerouting connection-mark=ISP1_conn \
in-interface=LAN new-routing-mark=to_ISP1
add action=mark-routing chain=prerouting connection-mark=ISP2_conn \
in-interface=LAN new-routing-mark=to_ISP2

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ISP1
add action=masquerade chain=srcnat out-interface=ISP2

/ip route
add check-gateway=ping distance=1 gateway=ISP1 routing-mark=to_ISP1
add check-gateway=ping distance=1 gateway=ISP2 routing-mark=to_ISP2
add check-gateway=ping distance=1 gateway=ISP1
add check-gateway=ping distance=2 gateway=ISP2


I'm currently just testing the two WAN lines with Private IP, But i'm unable to NAT out of the network. Please Advice
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Load Balance PCC issue? Advice needed

Thu May 01, 2014 11:29 pm

 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: Load Balance PCC issue? Advice needed

Thu May 01, 2014 11:45 pm

Oh. This is inspirative. I use netwatch for this purpose. But this could be faster. How often is checked the GW when ping check is in place? And of course, it disallows routing to fictive IPs if they are not fictive... What happens if redundant host checking is used and one host is down and other up? Does the recursive routing have any influence on perfirmance?
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Load Balance PCC issue? Advice needed

Fri May 02, 2014 1:11 am

This works in all situations.
 
Yuuki
just joined
Topic Author
Posts: 11
Joined: Fri Jan 17, 2014 3:12 pm

Re: Load Balance PCC issue? Advice needed

Fri May 02, 2014 4:03 am

This is fairly interesting... playing with the route distance.... I'll try it if PCC method really really doesn't work...

I'm trying to do a Load-Balance using this two WAN lines, or PCC isn't design for such usage? But just now I'm unable to surf the net. BUT if i enable the option DHCP client "add default route", it would work, I can surf the Net, But is PCC supposed to be configured this way?

how come the Mikrotik Wiki example can't even work?.... I'm confused...
Oh. This is inspirative. I use netwatch for this purpose. But this could be faster. How often is checked the GW when ping check is in place? And of course, it disallows routing to fictive IPs if they are not fictive... What happens if redundant host checking is used and one host is down and other up? Does the recursive routing have any influence on perfirmance?
Oh gosh.. that's just more questions to my question... :P
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Load Balance PCC issue? Advice needed

Fri May 02, 2014 8:40 am

It works. Your router always need IP and routes configured...
 
Yuuki
just joined
Topic Author
Posts: 11
Joined: Fri Jan 17, 2014 3:12 pm

Re: Load Balance PCC issue? Advice needed

Sat May 03, 2014 7:39 am

It works. Your router always need IP and routes configured...
You mean the Mikrotik Wiki Example Works? Why would the DHCP client default route need to be enabled?

when i have this?
/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=to_ISP1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.112.0.1 routing-mark=to_ISP2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.111.0.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.112.0.1 distance=2 check-gateway=ping

I'm utter lost right now...
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Load Balance PCC issue? Advice needed

Sat May 03, 2014 10:06 am

This route is for the router itself.

You dont mark the output chain... Then the router needs to have 2 default routes. One for isp1 and one for isp2.
 
pongko
just joined
Posts: 7
Joined: Wed Apr 30, 2014 2:56 am

Re: Load Balance PCC issue? Advice needed

Tue May 06, 2014 3:49 am

I always do like this ..

1. Create routing table for each ISP with its own gateway respectively.
2. Create routing rule for each ISP with its routing-mark respectively.

its work flawlessly..

Sorry for my English, I'm not English.. :)