نمایش نتایج: از شماره 1 تا 3 از مجموع 3

موضوع: راهنمایی در مورد پیاده سازی لودبالانسینگ

  
  1. #1
    نام حقيقي: Blackie

    عضو عادی شناسه تصویری hexman
    تاریخ عضویت
    Jul 2012
    محل سکونت
    تهران
    نوشته
    2,343
    سپاسگزاری شده
    406
    سپاسگزاری کرده
    852

    راهنمایی در مورد پیاده سازی لودبالانسینگ

    سلام فرض کنید من 2 تا لینک اینترنت دارم و یک میکروتیک فرض کنید در ساده ترین حالت برای پیاده سازی لود بالانسینگ به این شکل کانفیگ کردم میکروتیک رو:

    فرض کنید من میام سه خط روت مینویسم
    روت اول برای استفاده از هر 2 لینک هست:


    1.Dst address=0.0.0.0/0 Gateway=wan1,wan2
    2.Dst address=0.0.0.0/0 Gateway=wan1
    3.Dst address=0.0.0.0/0 Gateway=wan2



    حالا میخوام کاری کنم زمانی که هر 2 لینک UP هستند فقط خط 1 فعال باشه و هر وقت یکی از اونها قطع شد خط 1 غیر فعال بشه و یکی از خطهای 2 یا 3 بسته به اینکه کدوم خط قطع شده کار بکنه.
    حالا اگه خوام از نت واچ استفاده کنم برای تست کردن وصل بودن این خط ها مثلا میام یه ای پی رو برای وصل بودن لینک 1 و یک ای پی رو برای تست وصل بودن لینک 2 پینگ میکنم من چطوری میتونم به میکروتیک حالی کنم وقتی داری مثلا 4.2.2.4 رو پینگ میکنی از لینک 1 استفاده کن و وقتی داری مثلا 8.8.8.8 رو پینگ میکنی از لینک 2 استفاده کن تا قطع ودن هر یک از خطها جداگانه مشخص بشه؟




    موضوعات مشابه:

  2. #2
    نام حقيقي: Blackie

    عضو عادی شناسه تصویری hexman
    تاریخ عضویت
    Jul 2012
    محل سکونت
    تهران
    نوشته
    2,343
    سپاسگزاری شده
    406
    سپاسگزاری کرده
    852

    راستی در ویکی میکروتیک یه مطلب پیدا کردم در مورد لودبالانسینگ بدون اسکریپت نویسی ممنون میشم اگه نظرتون رو در مورش بفرمایید که فکر میکنید عملی هست یا خیر؟

    http://wiki.mikrotik.com/wiki/Advanc...hout_Scripting


    Advanced Routing Failover without Scripting


    Applies to RouterOS: v3, v4, v5

    Introduction

    Let us suppose that we have several WAN links, and we want to monitor, whether the Internet is accessible through each of them. The problem can be everywhere.
    If your VPN cannot connect - then there's no problem, your default route with gateway=that-vpn-connection will be inactive.
    If your ADSL modem is down - then check-gateway=ping is on stage, and no problem again.
    But what if your modem is up, and telephone line is down? Or one of your ISP has a problem inside it, so traceroute shows only a few hops - and then stops...
    Some people use NetWatch tool to monitor remote locations. Others use scripts to periodically ping remote hosts. And then disable routes or in some other way change the behaviour of routing.
    But RouterOS facilities allow us to use only /ip routes to do such checking - no scripting and netwatch at all!
    Implementation

    Basic Setup

    Let's suppose that we have two uplinks: GW1, GW2. It can be addresses of ADSL modems (like 192.168.1.1 and 192.168.2.1), or addresses of PPP interfaces (like pppoe-out1 and pptp-out1). Then, we have some policy routing rules, so all outgoing traffic is marked with ISP1 (which goes to GW1) and ISP2 (which goes to GW2) marks. And we want to monitor Host1 via GW1, and Host2 via GW2 - those may be some popular Internet websites, like Google, Yahoo, etc.
    First, create routes to those hosts via corresponding gateways:
    /ip route
    add dst-address=Host1 gateway=GW1 scope=10
    add dst-address=Host2 gateway=GW2 scope=10
    Now we create rules for ISP1 routing mark (one for main gateway, and another one for failover):
    /ip route
    add distance=1 gateway=Host1 routing-mark=ISP1 check-gateway=ping
    add distance=2 gateway=Host2 routing-mark=ISP1 check-gateway=ping
    Those routes will be resolved recursively (see Manual:IP/Route#Nexthop_lookup), and will be active only if HostN is pingable.
    Then the same rules for ISP2 mark:
    /ip route
    add distance=1 gateway=Host2 routing-mark=ISP2 check-gateway=ping
    add distance=2 gateway=Host1 routing-mark=ISP2 check-gateway=ping
    Multiple host checking per Uplink

    If Host1 or Host2 in #Basic Setup fails, corresponding link is considered failed too. For redundancy, we may use several hosts per uplink: let's monitor Host1A and Host1B via GW1, and Host2A and Host2B via GW2. Also, we'll use double recursive lookup, so that there were fewer places where HostN is mentioned.
    As earlier, first we need routes to our checking hosts:
    /ip route
    add dst-address=Host1A gateway=GW1 scope=10
    add dst-address=Host1B gateway=GW1 scope=10
    add dst-address=Host2A gateway=GW2 scope=10
    add dst-address=Host2B gateway=GW2 scope=10
    Then, let's create destinations to "virtual" hops to use in further routes. I'm using 10.1.1.1 and 10.2.2.2 as an example:
    /ip route
    add dst-address=10.1.1.1 gateway=Host1A scope=10 target-scope=10 check-gateway=ping
    add dst-address=10.1.1.1 gateway=Host1B scope=10 target-scope=10 check-gateway=ping
    add dst-address=10.2.2.2 gateway=Host2A scope=10 target-scope=10 check-gateway=ping
    add dst-address=10.2.2.2 gateway=Host2B scope=10 target-scope=10 check-gateway=ping
    And now we may add default routes for clients:
    /ip route
    add distance=1 gateway=10.1.1.1 routing-mark=ISP1
    add distance=2 gateway=10.2.2.2 routing-mark=ISP1
    add distance=1 gateway=10.2.2.2 routing-mark=ISP2
    add distance=2 gateway=10.1.1.1 routing-mark=ISP2
    Workaround 1

    In ROS versions at least up to 4.10 there's a bug, and if your ethernet interface goes down (for example, your directly connected ADSL modem is powered off) and then brings up, recursive routes are not recalculated (or something) and all traffic still goes via another uplink. As a workaround, additional rules for each HostN may be used. When adding them, all is recalculated correctly:
    /ip route
    add dst-address=Host1 type=blackhole distance=20
    add dst-address=Host2 type=blackhole distance=20




  3. #3
    نام حقيقي: Blackie

    عضو عادی شناسه تصویری hexman
    تاریخ عضویت
    Jul 2012
    محل سکونت
    تهران
    نوشته
    2,343
    سپاسگزاری شده
    406
    سپاسگزاری کرده
    852
    دوستان تو این سناریویی که تو پست قبلی گذاشتم نیاری به Mangle نداره؟یا نیاز داره منتها اینجا ذکر نکرده؟



کلمات کلیدی در جستجوها:

default route will be active در میکروتیک

لودبالانسينگ در ميكروتيك

نت واچ میکروتیک

برچسب برای این موضوع

مجوز های ارسال و ویرایش

  • شما نمی توانید موضوع جدید ارسال کنید
  • شما نمی توانید به پست ها پاسخ دهید
  • شما نمی توانید فایل پیوست ضمیمه کنید
  • شما نمی توانید پست های خود را ویرایش کنید
  •