Saturday, January 23, 2010

MikroTik Load Balancing

Condition: ISP where we work as an administrator to use more than one gateway to connect to the Internet. Everything must be able to serve the upstream & downstream service. Because the case would be different if one of them can only serve downstream, for example when using VSAT DVB One-way.
For this case in the example ISP has 2 lines to the Internet. One use access DSL (256 Kbps) and others use Wireless (512 Kbps). With DSL usage ratio: Wireless = 1:2.

What will be done:

1. Using all the available gateway channels with load-balancing techniques.
2. Making one as a back-up with fail-over technique.

OK, let's just get started experiments:

1. IP address for access to the LAN:
> / Ip address add address = 192.168.0.1/28 interface = LAN
IP address for access to DSL lines:
> / Ip address add address = 10.32.57.253/29 interface = DSL
IP address for access to lines Wireless:
> / Ip address add address = 10.9.8.2/29 interface = WIRELESS
Specify the gateway and the ratio of each:
> / Ip route add gateway = 10.32.57.254,10.9.8.1,10.9.8.1

2. In the case for fail-over technique. Assumed to be the main route through Wireless with DSL lines as a back-up if the main line were impassable. To check whether the main line can be passed or not, use the ping command.
> / Ip firewall mangle add chain = prerouting src-address = 192.168.0.0/28 action = mark-routing new-routing-mark = SUBNET1-RM
> / Ip route add gateway = 10.9.8.1 routing-mark = SUBNET1-RM check-gateway = ping
> / Ip route add gateway = 10.32.57.254

3. Good Luck!!

================================================== =====================================

seemed to use the proxy to be able to "load balancing" stay put 3 interface,

interface A for Speedy1, eg IP 192.168.1.1
interface B for Speedy2, eg IP 192.168.2.1
C interface to the LAN, for example IP 10.10.10.0/24


in mikrotik config like this:

> / Ip address add address = 10.10.10.0/24 interface = LAN
IP address for SpeedyA:
> / Ip address add address = 192.168.1.1/32 interface = SpeedyA
IP address for SpeedyB:
> / Ip address add address = 192.168.2.1/32 interface = SpeedyB
Next we specify the gateway and priorities:
> / Ip route add gateway = 192.168.1.1,192.168.2.1,192.168.2.1

Could also be added config for failover, jd example is one of the main speedy reply can die instantly using only speedy path,

> / Ip firewall mangle add chain = prerouting src-address = 10.10.10.0/24 action = mark-routing new-routing-mark = RM-SPEEDY
> / Ip route add gateway = 192.168.2.1 routing-mark = rm-speedyB check-gateway = ping
> / Ip route add gateway = 192.168.1.1


Or the other alternative is, we divide the traffic into two lanes speedy network group based on our LAN,

Our IP settings on each "proxy interface,

/ ip address add address 192.168.1.1/32 interface speedyA
/ ip address add address 192.168.2.1/32 interface speedyB
/ ip address add address 10.10.10.1/24 interface LAN

Next we try to network into Group 2

add chain = prerouting action = mark-connection src-address 10.10.10.0/25 new-routing-mark = Group-A
add chain = prerouting action = mark-connection src-address 10.10.10.128/25 new-routing-mark = Group-B

then we set the default gateway of each group

/ ip route add gateway = 192.168.1.1 routing-mark = Group-A
/ ip route add gateway = 192.168.2.1 routing-mark = Group-B

Make sure also we've set the NAT on our network

/ ip firewall nat add chain = srcnat src-address 10.10.10.0/24 action = masquerade

================================================== ==============================
Using 3 etrernet card

ether1 ==> wireless
ether2 ==> speedy
ethet3 ==> Lan

mikrotik command:
/ ip address add address 202.152.74.1/32 interface ether1
/ ip address add address 192.168.1.2/32 interface ether2
/ ip address add address 192.168.10.1/24 interface ether3

Ip divide into 2 Group

add chain = prerouting action = mark-connection src-address 192.168.10.0/25 new-routing-mark = Group-A
add chain = prerouting action = mark-connection src-address 192.168.10.128/25 new-routing-mark = Group-B

Default each Group

Group-A = 192.168.10.0/25 default 192.168.1.1

Group-B = 192.168.10.128/25 default 202.152.74.128

mikrotik command:

/ ip route add gateway = 192.168.1.1 routing-mark = Group-A
/ ip route add gateway = 202.152.74.128 routing-mark = Group-B

Local ip nat

192.168.10.0/24 ==> masquerade

mikrotik command:
/ ip firewall nat add chain = srcnat src-address 192.168.10.0/24 action = masquerade

================================================== ================================
ip route add dst-address = 0.0.0.0 / 0 gateway = 192.168.1.1 check-gateway = ping
ip route add dst-address = 0.0.0.0 / 0 gateway = 10.0.148.254 check-gateway = ping

Where 192.168.1.1 ADSL router & gateway 10.0.148.254 RT / RW-net use 2.4GHz so it's just ..
check the gateway using ping so if the gateway down
direct switch. If not directly on ya down 2 at the same time, wealthy hell load balancing

I just happened to add a parameter distance = 2 at the gateway RT / RW-net can be a lower priority ..

Firewall / NAT makes two seeds for each gateway

for easy client
add a default route IP-ether-mikrotik

PC / Router mikrotik I operate a LAN card 3
2 to the ADSL modem, LAN 1 toward the
clients are directed to the ethernet LAN gateway proxy only

Good luck and Good luck .... ...

4 comments:

  1. You actually make it seem so easy with your presentation but
    I find this matter to be actually something which I think I would never understand.
    It seems too complex and extremely broad for me.
    I am looking forward for your next post, I'll try to get the hang of it!

    Take a look at my website garage rubber floor Tiles

    ReplyDelete
  2. I visited many blogs however the audio feature for audio songs existing at this web page is genuinely excellent.


    my blog; stall mats for gym floor

    ReplyDelete
  3. I really love your blog.. Excellent colors & theme.
    Did you make this site yourself? Please reply back as I'm planning to create my very own blog and would like to know where you got this from or what the theme is named. Thank you!

    Feel free to surf to my website :: net web hosting services

    ReplyDelete
  4. It is perfect time to make some plans for the future and it is
    time to be happy.
    I have read this post and if I could I wish to suggest you few interesting things or advice.
    Perhaps you can write next articles referring to this article.

    I want to read even more things about it!

    My website :: purchase refinance ()

    ReplyDelete

semarang jawa tengah indonesia service keyboard service computer komputer kendal bali setting hotspot hacking password mysql protected username jasa setting jual beli
bobol password phpmyadmin debian 5 lenny ubuntu server surabaya sumatera american inggris access point microtic MikroTik jawa barat yamaha roland casio korg technic floppy disk emulator usb www universal cara ganti broadcast editing wireless Wi-Fi handphone novel health facebook Sepeda Fixie Jual Beli Sepeda Fixie Rose Network Sepeda Fixie Murah Wimax Wimax Indonesia, Long time waktu lorong waktu facebook twitter

Followers