In many location, including but definitely not limited to India, single ADSL / Cable connections can be unreliable and also may not provide sufficient bandwidth for your purposes.多くの場所、しかし、明らかに限定されるインドを含む、シングルadsl /ケーブルの接続信頼性に欠けるともできることができないお客様の目的に十分な帯域幅を提供します。 One way to increase reliability and bandwidth of your internet connection is to distribute the load (load balancing) using multiple connections. 1つの方法の信頼性を向上させるとしてインターネット接続の帯域幅を配布するが、負荷(ロードバランシング)を使用して複数の接続します。 It is also imperative to have transparent fail-over so routes are automatically adjusted depending on the availability of the connections.透明にすることも命令にはルートのフェールオーバーが自動的に調整するための空室状況に応じて、接続します。 With load balancing and fail-over you can have reliable connectivity over two or more unreliable broadband connections (like BSNL or Tata Indicom in India).フェールオーバーとロードバランシングと接続することができますが、 2つ以上の信頼性信頼性のブロードバンド接続(またはTata Indicomのように、インドのBSNL ) 。 I present you with the simplest solution to a complex problem with live examples.私の解決策を提示する最も単純な複雑な問題がライブ例を紹介します。

Note: Load balancing doesn’t increase connection speed for a single connection.注:負荷分散されないため、 1つの接続の接続速度の増加です。 Its benefits are realized over multiple connections like in an office environment.その利点は、複数の接続を実現するオフィス環境のようにします。 The benefits of fail-over are however realized even in a single user environment.の利点をフェールオーバーがしかし、 1つのユーザー環境でも実現します。

The load balancing mechanism, to be discussed with example below, in Linux caches routes and doesn’t provide transparent fail-over support.負荷分散のメカニズム、議論をされる例では、 Linuxにおけるキャッシュのルートではありません透明のフェールオーバーのサポートを提供します。 There are two solutions to incorporate transparent fail over - 1.透明なソリューションに組み込むには2つのフェールオーバー-1 。 compiling and using a custom Linux kernel withカスタムLinuxカーネルを使用して、コンパイルして、 Julian Anastasov’s kernel patchesユリウス暦anastasovのカーネルパッチ for dead gateway detection or 2.デッドゲートウェイの検出または2 。 user space script to monitor connections and dynamically change routing information.ユーザ空間のスクリプトを監視する接続およびルーティング情報を動的に変更します。

Julian Anastasov’s patches have two problems:ユリウス暦anastasovのパッチは2つの問題への取り組み:
1. 1 。 They work彼ら仕事 only when the first hop gateway is downときにのみ、最初のホップのゲートウェイがダウン .です。 In many cases, including ours, the first hop gateway is the adsl modem cum router which is always up.多くの場合、私たちを含め、最初のホップのゲートウェイは、ルータがADSLモデムを常に最新のごっています。 So we need a more robust solution for our purposes.より堅牢なソリューションを必要とするので、われわれの目的です。

2. 2 。 You have to compile a custom kernel with patches.カスタムカーネルをコンパイルする必要がでてパッチです。 This is somewhat complex procedure with reasonable chances of screwing up something.これは多少複雑な手続きを合理的なチャンスを何かねじアップします。 It also forces you to re-patch the kernel every time you decide to update your kernel.また、強制的にカーネルを再修正プログラムを更新するたびにしているカーネルを決定します。 Overall I wouldn’t recommend anyone going for kernel patching route unless that is the only option.全体の私はないカーネルパッチのルートを推奨しない限り、誰行くことが唯一のオプションを選択します。 Also in that case you should look for a rpm based solution (likeまた、この場合にはベースの解決策を探すのRPM (のような livna rpm for nVidia drivers nvidiaドライバのRPMをlivna ) which does it automatically for you. )には自動的に完了しています。

A better solution is to use a userspace program which monitors your connection and updates routes as necessary.より良い解決策はユーザプログラムを使用すると更新プログラムのルートを監視して、必要に応じて接続します。 I will provide a script which we use to constantly monitor our connections.私はこれを提供するには、スクリプトを使用しての接続を常に監視します。 It provides transparent fail over support with two ADSL connections.これは透明な2つのadsl接続のフェールオーバーをサポートします。 It is fully configurable and can be used for any standard dual ADSL / Cable connections to provide transparent fail over support.それが完全に任意の設定を標準で使うことができますデュアルadsl /ケーブルの接続を提供する透明なフェールオーバーをサポートします。 It can also be easily modified to use for more than two connections.これで簡単に更新することも2つ以上の接続に使用する。 You can also use it to log uptime / downtime of your connections使用することをログに記録することもできます。稼働時間/ダウンタイムの接続を like we didのようでした .です。

Let’s first discuss load balancing with two ADSL / Cable connections and then we will see how to provide transparent fail-over support.レッツ最初の2つの負荷分散について話し合うadsl /ケーブルの接続と入力し、我々はどのように透明なフェールオーバーサポートを提供しています。 The ideas and script provided here can be easily used for more than two connections with minor modifications.ここでアイデアやスクリプトを提供することで簡単に使用される2つ以上の接続をマイナー修正してください。

Requirements for Load Balancing multiple ADSL / Cable Connections負荷分散の要件を複数のadsl /ケーブルの接続

1. 1 。 Obviously you need to have multiple (A)DSL or Cable connections in the first place.明らかにする必要がありますに複数の(ア) DSLまたはケーブルの接続が、最初の場所です。 Login as root for this job.この仕事には、 rootとしてログインします。

2. 2 。 Find out the LAN / internal IP address of the modems.見つけて、無線LAN /内部IPアドレスは、モデムをサポートします。 They may be same like 1921.168.1.1. 1921.168.1.1年5月に彼らと同じようにします。
Check if the internal / LAN IP address of both (or multiple) modems are same.空の場合、内部/無線LANのIPアドレスの両方の(または複数)モデムは同じです。 In that use the web / telnet interface of the modems to configure one of the modems to have a different internal IP address preferably in different networks like 192.168.0.1 or 192.168.2.1 etc. If you are using multiple modems then you should configure each of them to have different subnets.を使用して、ウェブ/ telnetのインターフェイスは、モデムを構成する1つのモデムにはできれば、別の内部IPアドレス192.168.0.1または192.168.2.1などのような異なるネットワークを使用する場合は、複数のモデムを入力し、それぞれの設定しなければなりませんそれらには別のサブネットにします。 This is important because now you can easily access the different modems from their web interface and you don’t have to bother connecting to a modem through a particular interface.これは重要なため、今すぐに簡単にアクセスすることができますから、彼らのウェブの異なるインターフェイスとモデムを行う必要はありません面倒に接続してモデムを介して特定のインターフェイスです。 It is also important because now you can easily configure the interfaces to be associated with different netmasks / sub-network.することも重要なため、今すぐ簡単に構成することができます。関連付けられて別のインターフェイスをnetmasks /サブネットワークです。

3. 3 。 Connect each modem to the computer using a different interface (eth0, eth1 etc.).それぞれのモデムを接続するコンピュータを使用して、別のインターフェイス(のでeth0 、 eth1等)です。 You may be able to use the same interface but this guide doesn’t cover that.できることがあります同じインターフェイスを使用してカバーししかし、このガイドではありません。 In short you will make your life complicated using the same interface or even different virtual interface.あなたはあなたの人生は短い複雑なインターフェイスを使用して、同じまたは別の仮想インターフェイスさえします。 My recommendation is that you should use one interface per modem.私の推薦は、 1つのインターフェイスを使用する必要が1モデムを使用します。 Don’t scrimp on cheap ethernet adapters.格安のEthernetアダプタを切り詰めるはありません。 This has the added benefit of redundancy should one adapter go bad down the road.これは、付加的な利点の1つのアダプタの冗長性がダウンする道路が悪くなる。

4. 4 。 Configure the IP address of each interface to be in the same sub-network as the modem.各インターフェイスのIPアドレスを設定するには、同じサブネットワークとしては、モデムです。 For example my modems have IP addresses of 192.168.0.1 and 192.168.1.1.例えば、私のモデムのIPアドレスが192.168.0.1と192.168.1.1と入力します。 The corresponding addresses & netmasks of the interfaces are: 192.168.0.10 (netmask: 255.255.255.0) and 192.168.1.10 (netmask: 255.255.255.0).に対応するアドレス& netmasksは、インターフェイスは: 192.168.0.10 (ネットマスク: 255.255.255.0 )と192.168.1.10 (ネットマスク: 255.255.255.0 ) 。

5. 5 。 Find out the following information before you proceed with the rest of the guide:以下の情報を見つけて、処理を続行する前に、残りのガイド:

  1. IP address of external interfaces (interfaces connected to your modems).のIPアドレスを外部インターフェイス(インターフェイスに接続してモデム)です。 This is not the gateway address.これは、ゲートウェイのアドレスを入力します。
  2. Gateway IP address of each broadband connections.ゲートウェイのIPアドレスを各ブロードバンド接続します。 This is the first hop gateway, could be your DSL modem IP address if it has been configured as the gateway following the tip below.これは、最初のホップのゲートウェイは、 DSLモデムのIPアドレスがお客様の場合は、ゲートウェイが設定されて次のヒントとしては以下のとおり。
  3. Name, IP address & netmask of external interfaces like eth1, eth2 etc. My external interfaces are eth1 & eth2.名、 IPアドレス&ネットマスクのような外部インターフェイスeth1 、 eth2等の外部インターフェイスはeth1 & eth2です。
  4. Relative weights you want to assign to each connection.相対的に割り当てるに重りを各接続したいです。 My Tata connection is 4 times faster than BSNL connection.マイタタ接続が4倍以上の速さのBSNL接続します。 So I assign the weight of 4 to Tata and 1 to BSNL.だから4 〜タタの重量を割り当てると1 〜 BSNLのです。 You must use low positive integer values for weights.低正の整数を使用する必要があります分銅の値をします。 For same connection speeds weights of 1 & 1 are appropriate.接続速度は同じ重量の1 & 1が適切です。 The weights determine how the load is balanced across multiple connections.の重量負荷がどのようにバランスの取れた判断する複数の接続します。 In my case Tata is 4 times as likely to be used as route for a particular site in comparison with BSNL.私の場合はタタは4倍の高いルートとして使用され、特定のサイトと比較してのBSNLです。

Note: Refer to注:を参照して Netmask guideネットマスクガイド for details on netmasks.の詳細についてはnetmasksです。

Optional step オプションのステップ
Check theチェックして tips on configuring (A)DSL modemsヒントを設定する(ア) DSLモデム .です。 They are not required for using this guide.彼らはこのガイドを使用して必須ではありません。 However they are beneficial in maximizing your benefits.しかし彼らは有益な効果を極大化しています。

How to setup default load balancing for multiple ADSL / Cable connectionsデフォルトの負荷分散を設定する方法を複数のadsl /ケーブルの接続

Unlike other guides on this topic I will use a real example - the configuration on our internal network.このトピックに関する他のガイドとは異なり、私は実際の例を使用する-私たちの内部ネットワークの設定をします。 So to begin with here are the basic data for my network:を開始するための基本的なデータを、ここでは[マイネットワーク] :

#IP address of external interfaces. #のIPアドレスを外部インターフェイスです。 This is not the gateway address.これは、ゲートウェイのアドレスを入力します。
IP1=192.168.1.10 ip1 = 192.168.1.10
IP2=192.168.0.10 ip2 = 192.168.0.10

#Gateway IP addresses. #ゲートウェイのIPアドレスを入力します。 This is the first (hop) gateway, could be your router IPこれは、最初の(ホップ)ゲートウェイ、ルーターのIPがして
#address if it has been configured as the gateway #アドレスの場合は、ゲートウェイが設定されて
GW1=192.168.1.1 gw1 = 192.168.1.1
GW2=192.168.0.1 gw2 = 192.168.0.1

# Relative weights of routes. #相対重量のルートです。 Keep this to a low integer value.この低整数値を保持しています。 I am using 4私は使用して4
# for TATA connection because it is 4 times faster #タタ接続のため、これは4倍の速さ
W1=1 w1 = 1
W2=4図= 4

# Broadband providers name; use your own names here. #ブロードバンドプロバイダー名;使用して自身の名前をここにします。
NAME1=bsnlスペースname1 =のBSNL
NAME2=tata名前=タタ

You must change the example below to use your own IP addresses and other details.変更する必要があります以下の例を使用し、独自のIPアドレスやその他の詳細です。 Even with that inconvenience a real example is much easier to understand than examples with complex notations.さらに、その実際の例では不便を理解するよりもはるかに容易に複雑な記法の例です。 The example given below is copy-pasted from our intranet configuration.以下の例では、コピー&ペーストから与えられた私たちのイントラネットの構成します。 It works perfectly as advertised.宣伝として完璧に動作します。

Note: In this step fail-over is not addressed.注:この手順でアドレスのフェールオーバーではない。 It is provided later with a script which runs on startup.それが提供さへのスタートアップにするには、スクリプトが実行されています。

First you need to create two (or more) routes in the routing table ( /etc/iproute2/rt_tables ).最初の2つを作成する必要が(もしくはそれ以上)のルートは、ルーティングテーブル( / etc/iproute2/rt_tables ) 。 Open the file and make changes similar to what is show below.ファイルを開きますで変更を加えることに似ては何です詳細は以下のとおり。 I added the following for my two connections:私追加されました私は、次の2つの接続:

1 bsnl 1のBSNL
2 tata 2タタ

To add a default load balancing route for our outgoing traffic using our dual internet connections (ADSL broadband connections from BSNL & Tata Indicom) here are the lines I included in rc.local file:デフォルトの負荷分散を追加するにトラフィックを送信するルートを当社のインターネット接続を使用して、デュアル分( ADSLブロードバンド接続からのBSNL & Tata Indicomの)ここでは、私に含まれる行をrc.localファイル:

ip route add 192.168.1.0/24 dev eth1 src 192.168.1.10 table bsnl IPルートテーブルに追加192.168.1.0/24 devよりeth1 src 192.168.1.10のBSNL
ip route add default via 192.168.1.1 table bsnl IPルートテーブルに追加デフォルト経由で192.168.1.1のBSNL
ip route add 192.168.0.0/24 dev eth2 src 192.168.0.10 table tata IPルートテーブルに追加192.168.0.0/24 devよりeth2 src 192.168.0.10タタ
ip route add default via 192.168.0.1 table tata IPルートテーブルadd default via 192.168.0.1コマンドタタ
ip rule add from 192.168.1.10 table bsnl テーブルのBSNLから192.168.1.10のIPルールを追加
ip rule add from 192.168.0.10 table tata タタ192.168.0.10テーブルからのIPルールを追加
ip route add default scope global nexthop via 192.168.1.1 dev eth1 weight 1 nexthop via 192.168.0.1 dev eth2 weight 4 デフォルトのスコープのグローバルIPルートを追加nexthop経由で192.168.1.1 devよりeth1経由での重量1 nexthop 192.168.0.1 devよりeth2重量4

Adding them to rc.local ensures that they are execute automatically on startup. rc.local追加するには確実に彼らは起動時に自動的に実行します。 You can also run them manually from the command line.手動で実行することもできますし、コマンドラインからです。

This completes the load balancing part.この部分が完了して負荷分散します。 Let’s now see how we can achieve fail-over so the routes are automatically changed when one or more connections are down and then changed again when one or more more connections come back up again.レッツ今すぐ私たちはどのように達成するためのルートのフェールオーバーが自動的に変更されるので、 1つまたは複数の接続がダウンして、変更を再度入力し、 1つまたは複数の他の接続時に再び戻っています。 To do this magic I used a script.これを行うには魔法の私するには、スクリプト使われています。

How to setup fail-over over multiple load balanced ADSL / Cable connectionsフェールオーバーを設定する方法について、複数の負荷バランスの取れたadsl /ケーブルの接続

Please follow the steps below and preferably in the same order:次の手順に従って、できればと同じ順序:

  1. First最初の download the scriptスクリプトをダウンロードして which checks for and providesこれをチェックし、提供 fail-over over dual ADSL / Cable internet connectionsフェールオーバーのデュアルadsl /ケーブルインターネット接続 and save it to /usr/sbin directory (or any other directory which is mounted available while loading the OS).と保存することを/ usr / sbinディレクトリ(あるいは他のディレクトリを読み込んでいますがマウントさがご利用中のOS )です。
  2. Change the file permissions to 755:ファイルのアクセス権を変更して755 :
    chmod 755 /usr/sbin/gwping にchmod 755 / usr / sbin / gwping
  3. Open the file (as root) in an editor like vi or gedit and edit the following parameters for your environment:ファイルを開きます( rootで)は、エディタのようなviやGeditでは、以下のパラメータを編集している環境:

    #IP Address or domain name to ping. # IPアドレスまたはドメイン名にpingを実行します。 The script relies on the domain being pingable and always availableこのスクリプトは、ドメインに依存して、常に利用可能なping送信
    TESTIP=www.yahoo.com testip = www.yahoo.com

    #Ping timeout in seconds # pingを実行タイムアウトを秒単位で
    TIMEOUT=2タイムアウト= 2

    # External interfaces #外部インターフェイス
    EXTIF1=eth1 extif1 = eth1
    EXTIF2=eth2 extif2 = eth2

    #IP address of external interfaces. #のIPアドレスを外部インターフェイスです。 This is not the gateway address.これは、ゲートウェイのアドレスを入力します。
    IP1=192.168.1.10 ip1 = 192.168.1.10
    IP2=192.168.0.10 ip2 = 192.168.0.10

    #Gateway IP addresses. #ゲートウェイのIPアドレスを入力します。 This is the first (hop) gateway, could be your router IPこれは、最初の(ホップ)ゲートウェイ、ルーターのIPがして
    #address if it has been configured as the gateway #アドレスの場合は、ゲートウェイが設定されて
    GW1=192.168.1.1 gw1 = 192.168.1.1
    GW2=192.168.0.1 gw2 = 192.168.0.1

    # Relative weights of routes. #相対重量のルートです。 Keep this to a low integer value.この低整数値を保持しています。 I am using 4私は使用して4
    # for TATA connection because it is 4 times faster #タタ接続のため、これは4倍の速さ
    W1=1 w1 = 1
    W2=4図= 4

    # Broadband providers name; use your own names here. #ブロードバンドプロバイダー名;使用して自身の名前をここにします。
    NAME1=BSNLスペースname1 =のBSNL
    NAME2=TATA名前=タタ

    #No of repeats of success or failure before changing status of connection #ないの成功または失敗の繰り返しを接続の状態を変更する前に
    SUCCESSREPEATCOUNT=4 successrepeatcount = 4
    FAILUREREPEATCOUNT=1 failurerepeatcount = 1

    Note: Four consecutive success indicates that the gateway is up and one (consecutive) failure indicates that the gateway went down for my environment.注:成功を示して、 4つの連続すると1つのゲートウェイは(連続)の失敗を示して私の環境でのゲートウェイがダウンします。 You may want to modify it to better match your environment.それを変更することができますマッチしている環境を改善します。

  4. Add the following line to the end of /etc/rc.local file:に以下の行を追加しての最後の/ etc / rc.localファイル:
    nohup /usr/sbin/gwping & nohup / usr / sbin / gwping &

In the end my /etc/rc.local file has the following lines added in total:での最後に私の/ etc / rc.localファイルには、以下の行が追加されました合計:

ip route add 192.168.1.0/24 dev eth1 src 192.168.1.10 table bsnl IPルートテーブルに追加192.168.1.0/24 devよりeth1 src 192.168.1.10のBSNL
ip route add default via 192.168.1.1 table bsnl IPルートテーブルに追加デフォルト経由で192.168.1.1のBSNL
ip route add 192.168.0.0/24 dev eth2 src 192.168.0.10 table tata IPルートテーブルに追加192.168.0.0/24 devよりeth2 src 192.168.0.10タタ
ip route add default via 192.168.0.1 table tata IPルートテーブルadd default via 192.168.0.1コマンドタタ
ip rule add from 192.168.1.10 table bsnlテーブルのBSNLから192.168.1.10のIPルールを追加
ip rule add from 192.168.0.10 table tataタタ192.168.0.10テーブルからのIPルールを追加
ip route add default scope global nexthop via 192.168.1.1 dev eth1 weight 1 nexthop via 192.168.0.1 dev eth2 weight 4デフォルトのスコープのグローバルIPルートを追加nexthop経由で192.168.1.1 devよりeth1経由での重量1 nexthop 192.168.0.1 devよりeth2重量4
nohup /usr/sbin/gwping & nohup / usr / sbin / gwping &

An astute reader may note that the default setup with dual load balanced routing (7th line) is really not required as the script is configured to force routing based on the current status the very first time.抜け目のないリーダーに、デフォルトのセットアップを5月に注意して二重の負荷バランスの取れたルーティング( 7行)が本当に必要とされる特定のスクリプトを構成して強制的に基づいてルーティングの現在の状態は非常に最初の時間です。 However it is there to ensure proper routing before the script forces the routing for the first time which is about 40 seconds in my setup (can you tell why it takes 40 second for the first time?).しかしこれは適切なルーティングを確保するために強制的にルーティングする前にスクリプトの最初の時間は約40秒で私のセットアップ(なぜそれが分かるまで40時間の最初の2番目のですか? )です。

Concluding thoughts 結びの考え
In the process of finding and coding the simple solution above, I read several documents on routing including the famousと符号化の過程で、簡単な解決策を見つけるように、いくつかの文書を読んだのルーティングなどの有名な lartc how-to lartcどのように (many of whose commands didn’t work as described on my Fedora Core system) & nano.txt among several others. (そのコマンドの多くは説明しなかったとして働く私のFedora Coreのシステム) & nano.txtのうちいくつかの他のです。 I think I have described the simplest possible solution for load balancing and transparent failover of two or more DSL / Cable connections from one or more providers where channel bonding is not provided upstream (requires cooperation from one or more DSL providers); which is the most common scenario.と思うが、できるだけ簡単な解決策を記述して負荷分散と透明性のフェールオーバーを2つ以上のDSL /ケーブル接続を1つまたは複数のプロバイダのどこからではないチャンネルボンディングインターフェース提供上流(必要な協力を得て1つまたは複数のDSLプロバイダー) ;これは、最も共通のシナリオです。 I would welcome suggestions and improvements to this document.私の提案を歓迎し、このドキュメントの改善をします。

The solution has been well tested in multiple real and artificial load condition and works extremely well with users never realizing when a connection went down or came back up again.よくテストされ、解決策を複数の現実的かつ人工的負荷条件と動作を実現するときに非常によく、ユーザーの接続は決してダウンしているか再び帰ってきた。

Networking is a complex thing and it is conceivable that you may run into issues not covered here.ネットワーキングは、複雑なものと考えられることは問題のないことを実行することがあります扱いません。 Feel free to post your problems and solutions here.気軽な問題と解決法を作成してください。 However, while I would like to, I will not be able to debug and solve individual problems due to time constraints.しかし、したいのを、私は解決することはできませんと個々の問題をデバッグする時間的な制約のために。

I may however be able to offer useful suggestions to your unique problems.私年5月しかし有用なアドバイスを提供することは、お客様それぞれの問題が発生します。 It may however be noted that I respond well toしかしことがありますに注意して私によく反応する Café Estima Blend™ by Starbuckカフェエスティマ™をブレンドスターバックス s and move much quicker on my todo list. sと移動してTODOリストくらい速いです。 It is also great as aこれは素晴らしいとしても token of appreciation for my hard workトークンの感謝の意を私のハードワーク .です。 The “velvety smooth and balanced with a roasty-sweet flavor this blend of coffees is a product of the relationships formed between” us. "ビロードのような滑らかでバランスの取れたroasty -甘い風味をブレンドしたこのコーヒーは、製品の間の関係の形成"問い合わせください。

In a followup article I discussed how toフォローアップfollow-up名詞、形容詞フォーム記事私form;する方法を議論 configure single / dual / multiple ADSL / cable connections, firewall, gateway / NAT With Shorewall Firewall構成するシングル/デュアル/複数のadsl /ケーブルの接続、ファイアウォール、ゲートウェイ/ファイアウォールのNATをshorewall .です。