🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.openbsd-pf
Article #92

Re: NAT out to two DSL modems

#92
From: Ben Harper
Date: Wed, 20 Jul 2011 08:15
94 lines
4980 bytes
--0015174737aab19f0d04a87aff44
Content-Type: text/plain; charset=ISO-8859-1

Thanks!

On Tue, Jul 19, 2011 at 4:42 PM, Stuart Henderson <stu@spacehopper.org>wrote:

> On 2011/07/19 06:49, Ben Harper wrote:
> > Hi,
> > I'm trying to NAT out to two DSL modems.
> > I have three network cards on three subnets:
> > re0: 192.168.4.0/24         Internal
> > re1: 41.134.100.222/29    DSL_A
> > re2: 10.10.10.5/24           DSL_B
> >
> > I can NAT out to either re1 or re2, but I have to make my default
> > gateway point to the relevant gateway on that network.
> > How can I tell the route tables or the nat-to command what the gateway
> > machine is?
> >
> > So I can do this, but ***only if my default gateway is
> > 41.134.100.217*** (which is the gateway for that net):
> > pass out on re1 proto tcp from 192.168.4.0/24 to any nat-to re1
> >
> > Likewise, I can do this, but once again, ***only if my default gateway
> > is 10.10.10.1*** (which is the gateway for that net):
> > pass out on re2 proto tcp from 192.168.4.0/24 to any nat-to re2
> >
> > I believe I should be able to make this work without ANY default
> > gateway. But then where do I tell the system
> > what these two gateway machines are?
>
> You need *A* default gateway, but it doesn't matter which you choose.
> Then use "route-to {41.134.100.217@re1, 10.10.10.1@re2}" to redirect
> traffic and nat-to rules for outbound traffic on the relevant interfaces.
> You also need similar tricks with reply-to if you want to accept
> incoming traffic and make sure replies go out the correct interface.
>
>

--0015174737aab19f0d04a87aff44
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks!<br><br><div class=3D"gmail_quote">On Tue, Jul 19, 2011 at 4:42 PM, =
Stuart Henderson <span dir=3D"ltr">&lt;<a href=3D"mailto:stu@spacehopper.or=
g">stu@spacehopper.org</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex;">

On 2011/07/19 06:49, Ben Harper wrote:<br>
&gt; Hi,<br>
&gt; I&#39;m trying to NAT out to two DSL modems.<br>
&gt; I have three network cards on three subnets:<br>
&gt; re0: <a href=3D"http://192.168.4.0/24" target=3D"_blank">192.168.4.0/2=
4</a> =A0 =A0 =A0 =A0 Internal<br>
&gt; re1: <a href=3D"http://41.134.100.222/29" target=3D"_blank">41.134.100=
.222/29</a> =A0 =A0DSL_A<br>
&gt; re2: <a href=3D"http://10.10.10.5/24" target=3D"_blank">10.10.10.5/24<=
/a> =A0 =A0 =A0 =A0 =A0 DSL_B<br>
&gt;<br>
&gt; I can NAT out to either re1 or re2, but I have to make my default<br>
&gt; gateway point to the relevant gateway on that network.<br>
&gt; How can I tell the route tables or the nat-to command what the gateway=
<br>
&gt; machine is?<br>
&gt;<br>
&gt; So I can do this, but ***only if my default gateway is<br>
&gt; 41.134.100.217*** (which is the gateway for that net):<br>
&gt; pass out on re1 proto tcp from <a href=3D"http://192.168.4.0/24" targe=
t=3D"_blank">192.168.4.0/24</a> to any nat-to re1<br>
&gt;<br>
&gt; Likewise, I can do this, but once again, ***only if my default gateway=
<br>
&gt; is 10.10.10.1*** (which is the gateway for that net):<br>
&gt; pass out on re2 proto tcp from <a href=3D"http://192.168.4.0/24" targe=
t=3D"_blank">192.168.4.0/24</a> to any nat-to re2<br>
&gt;<br>
&gt; I believe I should be able to make this work without ANY default<br>
&gt; gateway. But then where do I tell the system<br>
&gt; what these two gateway machines are?<br>
<br>
You need *A* default gateway, but it doesn&#39;t matter which you choose.<b=
r>
Then use &quot;route-to {41.134.100.217@re1, 10.10.10.1@re2}&quot; to redir=
ect<br>
traffic and nat-to rules for outbound traffic on the relevant interfaces.<b=
r>
You also need similar tricks with reply-to if you want to accept<br>
incoming traffic and make sure replies go out the correct interface.<br>
<br>
</blockquote></div><br>

--0015174737aab19f0d04a87aff44--
Technical Details
Message-ID: <CAMKhK9Ts5fFaki23DxNmzd1+jtPprrev3tdeMDUaejpRTvR6uQ@mail.gmail.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!195.208.113.67.MISMATCH!goblin1!goblin.stu.neva.ru!news.mi.ras.ru!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrn
References: <20110719144200.GJ17257@symphytum.spacehopper.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: ff4ef,c6212e92901498ac
X-Google-NewGroupId: yes
X-Google-Attributes: gidbffa70e3,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!195.208.113.67.MISMATCH!goblin1!goblin.stu.neva.ru!news.mi.ras.ru!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrn
From: rogojin@gmail.com (Ben Harper)
Newsgroups: bit.listserv.openbsd-pf
Subject: Re: NAT out to two DSL modems
Date: 20 Jul 2011 01:15:56 -0700
Organization: None
Lines: 94
Message-ID: <CAMKhK9Ts5fFaki23DxNmzd1+jtPprrev3tdeMDUaejpRTvR6uQ@mail.gmail.com>
References: <20110719144200.GJ17257@symphytum.spacehopper.org>
NNTP-Posting-Host: localhost.newsguy.com
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=0015174737aab19f0d04a87aff44
NNTP-Posting-Date: 20 Jul 2011 08:15:57 GMT