All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Luis Domingo López" <lartc@24x7linux.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Iptables, SNAT/MASQ,  Multiple gateways
Date: Sun, 29 Sep 2002 22:45:33 +0000	[thread overview]
Message-ID: <marc-lartc-103333960613784@msgid-missing> (raw)
In-Reply-To: <marc-lartc-103332395202631@msgid-missing>

On Sunday, 29 September 2002, at 11:24:03 -0700,
Simon Matthews wrote:

> I have a dual-homed firewall. It has 2 Internet connections, provided by
> different ISPs (each with an associated IP address). The 2 Internet
> connections are connected to the same physical interface. The 2 Internet
> connections do NOT have equal bandwidth
> 

> How do I configure the SNAT/MASQ and ensure sharing of the gateways with
> the correct ratio of usage and with the correct source IP address? 
> 
ip route add default nexthop via $CONN1_IP dev $ETHX weight $X \
                     nexthop via $CONN2_IP dev $ETHX weight $Y

weight(s) are the relative bandwidths of the connections. If the first
is a 2 Mbps line and the second a 512 Kbps one, $=4 and $Y=1, for example.
What matters is the ratio, not the actual bandwidth.

> I know how to use the 'ip' commands to configure gateway sharing according
> to my defined ratios and ensure that packets go out of the correct gateway 
> according to their source address.
> 
The above defines routing. And SNAT/MASQ is something done afterwards,
so you could SNAT/MASQ traffic going to each connection differently.
What I don't know right now is how to determine to which Internet
connection are packets going in your setup with only an ethernet card
for both. With a card for each Internet connection it is simple.

Hope this helps.

-- 
Jose Luis Domingo Lopez
Linux Registered User #189436     Debian Linux Woody (Linux 2.4.19-pre6aa1)
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  reply	other threads:[~2002-09-29 22:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-29 18:24 [LARTC] Iptables, SNAT/MASQ, Multiple gateways Simon Matthews
2002-09-29 22:45 ` José Luis Domingo López [this message]
2002-09-30  5:18 ` Don Cohen
2002-09-30  7:06 ` Simon Matthews
2002-09-30 15:55 ` Don Cohen
2002-09-30 17:05 ` Michael T. Babcock
2002-09-30 18:11 ` Jose Luis Domingo Lopez
2002-09-30 19:23 ` Julian Anastasov
2002-09-30 19:24 ` Simon Matthews
2002-09-30 19:26 ` Simon Matthews
2002-09-30 19:41 ` Greg Scott
2002-10-01  4:12 ` William L. Thomson Jr.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-103333960613784@msgid-missing \
    --to=lartc@24x7linux.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.