Peeyush Maurya's Technical Guide Still Under Construction

 

Two ISP and Linux Routing for Load Balancing :

--------------------------------------------------------------------------------

Cool...


 i have:
 eth0: 200.41.233.211  <--ISP one
 eto0:1: 200.47.43.240 <-- ISP two
 eth1: private (for masquerading).
 

My example doesn't work, because it requires two interfaces; however, the basic principle is the same.

Presumably you are doing this because you have two ISP's with two routers or switches that can tolerate being directly connected on a single Ethernet segment. (I don't have this situation--if I connect both ISP's to one Ethernet card, each will receive all of the traffic the other sends. This is bad. Very bad.) If this is not the case, e.g. you have two ISPs but you have two IP addresses at one of them, for a total of three IP's at two ISP's, use a mixture of this
example and my previous one.

Assume that you have two ISP's connected to eth0, like this:

ISP #1: ip 1.2.3.4, netmask 255.255.255.0, gateway 1.2.3.1
ISP #2: ip 1.2.4.5, netmask 255.255.255.0, gateway 1.2.4.1

and on eth1:

private network: 10.1.2.3, netmask 255.0.0.0, no gateway

Then you set up the routing tables like this:

# Private network gets its own routing table
ip rule add pref 100 to 10.0.0.0/8 table 100
ip route add 10.0.0.0/8 dev eth1 table 100

# ISP #1 gets their own routing table
ip rule add pref 200 from 1.2.3.4 table 101
ip route add default via 1.2.3.1 table 101

# ISP #2 gets their own routing table
ip rule add pref 200 from 1.2.4.5 table 102
ip route add default via 1.2.4.1 table 102

# Everything else in the main routing table.
ip route add 1.2.3.0/24 dev eth0
ip route add 1.2.4.0/24 dev eth0

# Note that "dev eth0" shouldn't be necessary,
# but I haven't tested this...
ip route add default \
nexthop via 1.2.3.1 dev eth0 \
nexthop via 1.2.4.1 dev eth0

# Start it all
ip route flush cache

Note that this is almost identical to my previous example, except that instead of using two devices, you use one device with two gateways.

Regardless, you always use the source address to select which routing table, and you give each ISP their own routing table.

Any route query that doesn't have an associated source address gets the default, which assigns a route to one of the ISP's gateways at random.

If you have an entire subnet, rather than a single IP address, use this form:

# Your machine has subnet 1.2.3.0/24, with the ISP's gateway  at 1.2.3.1:
ip rule add pref 200 from 1.2.3.0/24 table 100
ip route add 1.2.3.1 dev eth0

This assumes you have the entire 1.2.3.0/24 address space, except for the gateway.

--
Copied from somewhere someplace...:)

Another Link For two ISP and linux

Some links are just from original website, my write-up will be here soon. Thanks for reading.

Tips For Computer User

- Update Antivirus Daily
- Install Spyware Software (Adaware free)
- Scandisk And Defrag Computer every fortnight
- Run Complete Virus Scan
- Run Online Virus Scan (Free). List Coming Soon
- Uninstall Programs which you don't use
- Ask for help if you are not sure what you are doing.

Secure Yourself

- Install Firewall (many free available)
-
Run NMAP and check how strong your firewall is. There are many Port Scanner are available free which can help to build a strong , hack proof Firewall
- Netstat : another basic command for checking your connected ports.

Remote Connection

- VNC (Best and free) Bitmap based works on Linux and Windows.
- RDesktop : Use Windows Desktop in Linux (better than terminal client)

Search Yahoo


-

Guardster Free Web Proxy

Hide what you are surfing, no log file or Blocking of web site
Write to me if you have any questions/doubts or needs any technical help (no Charges)
mail me at peeyush_maurya@yahoo.com or peeyush_maurya@maurya.biz.ly

Sign Guestbook to boost my moral :: View Guestbook

..>.>..