Skip to contentSkip to conversation

Need urgent help on NAT/load sharing

DISCUSSION Saeed Zamani 5 participants 5 messages Feb 5, 2004 – Feb 6, 2004

lore
Share & tools
lore
#0 lore raw

Hi all,
I am new to list and have a basic nat question on Redhat Linux 9. I
have to translate my local IP ( 192.168.1.0/24 ) to two different public IP given by two different ISP ( IPE1 & IPE2 ) at a specified rate. For example for every 4 received packet, one have to translate to IPE1 and other three to IPE2. I need this for load balacing the internet traffic between two isp. At the end, it is excellent if there is an option that If one the ISP gateway is dead, all packets have to translate to other public IP. Please help me.
Thanks,
Saeed Zamani,
Technical Manager,
Concept FZ LLC.

#1 lore raw

Good morning, Saeed,

Quoted 8 lines · Saeed Zamani

I am new to list and have a basic nat question on Redhat Linux 9. I
have to translate my local IP ( 192.168.1.0/24 ) to two different public IP given by two different ISP ( IPE1 & IPE2 ) at a specified rate. For example for every 4 received packet, one have to translate to IPE1 and other three to IPE2. I need this for load balacing the internet traffic between two isp. At the end, it is excellent if there is an option that If one the ISP gateway is dead, all packets have to translate to other public IP. Please help me.

I don't know the answer off the top of my head, but you might want
to take a look at the Linux Advanced Routing and Traffic Control HOWTO at
http://www.lartc.org/ .
Cheers,
- Bill

---------------------------------------------------------------------------
"All programs evolve until they can send email."
-- Richard Letts
"Except Microsoft Exchange."
-- Art
(found on the Snort web site)
--------------------------------------------------------------------------
William Stearns ([email protected]). Mason, Buildkernel, freedups, p0f,
rsync-backup, ssh-keyinstall, dns-check, more at: http://www.stearns.org
--------------------------------------------------------------------------

#2 lore raw
In reply to Saeed Zamani

Hello, Saeed!

Replying to your letter:

S> Hi all,
S> I am new to list and have a basic nat question on Redhat Linux 9. I
S> have to translate my local IP ( 192.168.1.0/24 ) to two different public S> IP given by two different ISP ( IPE1 & IPE2 ) at a specified rate. For S> example for every 4 received packet, one have to translate to IPE1 and S> other three to IPE2. I need this for load balacing the internet traffic S> between two isp. At the end, it is excellent if there is an option that S> If one the ISP gateway is dead, all packets have to translate to other S> public IP. Please help me.
S> Thanks,
S> Saeed Zamani,
S> Technical Manager,
S> Concept FZ LLC.
I think, you can balance when you are connecting to another ports So, if you are connecting to port 80, you can NAT packets to IPE1, and another packets to IPE2

iptables -t nat -A POSTROUTING -p tcp --dport 80 -j SNAT --to-destination ipe1.ip.address
iptables -t nat -A POSTROUTING -j SNAT --to-destination ipe2.ip.address

Signature · 8 lines
Best Regards, Saeed!

Friday, February 6, 2004, 9:49

Olexandr O. Galay
mailto:[email protected]
http://www.macros.org.ua
ICQ: 29292281
#3 lore raw
In reply to Saeed Zamani

The Linux Advanced Routing Howto makes a point on it, take a look at www.lartc.org specifically:
http://lartc.org/howto/lartc.rpdb.multiple-links.html
You'll only have to change the weight on the lines. Also note that you can onlky balance outgoing connections that way, not inbound ones.

Hope this helps you ;)

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Saeed Zamani Enviado el: jueves, 05 de febrero de 2004 18:25
Para: [email protected]
Asunto: Need urgent help on NAT/load sharing

Hi all,
I am new to list and have a basic nat question on Redhat Linux 9. I
have to translate my local IP ( 192.168.1.0/24 ) to two different public IP given by two different ISP ( IPE1 & IPE2 ) at a specified rate. For example for every 4 received packet, one have to translate to IPE1 and other three to IPE2. I need this for load balacing the internet traffic between two isp. At the end, it is excellent if there is an option that If one the ISP gateway is dead, all packets have to translate to other public IP. Please help me.
Thanks,
Saeed Zamani,
Technical Manager,
Concept FZ LLC.

#4 lore raw
In reply to Saeed Zamani

you need iproute2 to use both providers links.

----- Original Message -----
From: "Saeed Zamani" <[email protected]>
To: <[email protected]>
Sent: Thursday, February 05, 2004 2:24 PM
Subject: Need urgent help on NAT/load sharing

Quoted 17 lines

Hi all,
I am new to list and have a basic nat question on Redhat Linux 9. I
have to translate my local IP ( 192.168.1.0/24 ) to two different public IP given by two different ISP ( IPE1 & IPE2 ) at a specified rate. For example for every 4 received packet, one have to translate to IPE1 and other three to IPE2. I need this for load balacing the internet traffic between two isp. At the end, it is excellent if there is an option that If one the ISP gateway is dead, all packets have to translate to other public IP. Please help me.
Thanks,
Saeed Zamani,
Technical Manager,
Concept FZ LLC.