Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Oct 2000 19:37:07 -0400
From:      "John Telford" <j.telford@sympatico.ca>
To:        <nick@rapidnet.com>
Cc:        <freebsd-net@FreeBSD.ORG>
Subject:   Multihomed natd, nics and default gateways continued.
Message-ID:  <002601c03fa5$a760da30$0100000a@johnny5>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Nick,
You are wise in the ways of FreeBSD and routing. Could you take a moment and provide some tips on how I could expand on your help to John Prince ?
I have a similar setup but would like it to behave slightly differently. My setup:
1 internal interface.
1 external interface doing natd, default gateway routing for the internal to an isp.
We have now brought in a second ISP and put a 3rd interface into the Freebsd box. I'd like to have a setup like this:

ISPA-----------interface A_fxp0
                                fxp2_NATD--interface C---------internal network 10.130.x.x
ISPB-----------interface b_fxp1  

I would like to have all internal -> external traffic route through ISPA. In the event that ISPA goes down then the ISPB connection should take over automatically with out the users noticing except that things are slower because ISPB is a slower connection. This means the default gateway would have to change on the fly and I can't seem to locate much information on how this can work.

Thanks in advance, John 
 
Nick wrote:
DATE: 10/25/2000 19:58:00
SUBJECT: RE:  Multipath natd
 n Wed, 25 Oct 2000, John Prince wrote:

> Hello..
> Is it possible (I have been trying)....
> I have noticed other requests, however there does not seem to be any answers..
> 
> I have a firewall setup, IPFW and Natd, with 2 external interfaces, and a 
> single internal.
> Each external interface is connected to a provider.
> Setup is as follows..
> External Internal.
> bbb.bbb.bbb.bbb ---------------
> |--------------- ccc.ccc.ccc.ccc
> aaa.aaa.aaa.aaa ---------------
> The internal network consists of 2 nets, 10.0.1.0 and 10.0.2.0
> What I want to do is route any traffic from the 10.0.1.0 network to the 
> (bbb) external
> interface, and traffic from the 10.0.2.0 to the the (aaa) interface..
> Ipfw and Natd appear to function, as long as I specify a default route..
> I would like to do this all on a single machine, if possible..
> Any help would be greatly appreciated..

	It`s possible.  Run 2 differnet natd`s.  Setup ipfw like so:

	#Don;t Divert local traffic
	ipfw add 50 allow ip from 10.0.1.0/24 to 10.0.2.0/24
	ipfw add 51 allow ip from 10.0.2.0/24 to 10.0.1.0/24

	#Dvert traffic from 1.0/24 out and in interface B
	ipfw add 100 divert natd ip from 10.0.1.0/24 to any
	ipfw add 101 divert natd ip from any to any in via $INTERFACE_B

	#Divert traffic from 2.0/24 network in and out int a
	ipfw add 200 divert natd2 ip from 10.0.2.0/24 to any
	ipfw add 201 divert natd2 ip from any to any in via $INTERFACE_A


	#Add routing for these natd`d addresses
	ipfw add 1000 fwd $INTERFACE_B_NEXT_HOP ip from 
	$INTERFACE_B_ADDRESS to any

	ipfw add 2000 fwd $INTERFACE_A_NEXT_HOP ip from 
	$INTERFACE_A_ADDRESS to any

	#Leave on for testing until it works
	ipfw add 3000 allow ip from any to any

	Then after you do that setup the 2 different natd`s to listen on
	different ports (default 8668) and another entry int
	/etc/services:

		natd2           8669/divert # Network Address Translation

	Then run the nat`s seperately:

		root# natd -p 8668 -a $INTERFACE_B_ADDRESS
		root# natd -p 8669 -a $INTERFACE_A_ADDRESS



Nick Rogness
- Drive defensively.  Buy a tank.


[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT size=3>Nick,</FONT></FONT></DIV>
<DIV><FONT face=Arial>You are wise in the ways&nbsp;of FreeBSD and routing. 
Could you take a moment and provide some tips on how I could expand on your help 
to John Prince ?</FONT></DIV>
<DIV><FONT face=Arial>I have a similar setup but would like it to behave 
slightly differently. My setup:</FONT></DIV>
<DIV><FONT face=Arial>1 internal interface.</FONT></DIV>
<DIV><FONT face=Arial>1&nbsp;external interface doing natd,&nbsp;default gateway 
routing for the internal to an isp.</FONT></DIV>
<DIV><FONT face=Arial>We have now brought in a second ISP and put a 3rd 
interface into the Freebsd box. I'd like to have a setup like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>ISPA-----------interface A_fxp0</FONT></DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fxp2_NATD--interface 
C---------internal network 10.130.x.x</FONT></DIV>
<DIV><FONT face=Arial size=2>ISPB-----------interface 
b_fxp1</FONT>&nbsp;&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I would like to have all internal -&gt; external 
traffic route through ISPA. In the event that ISPA goes down then the ISPB 
connection should take over automatically with out the users noticing except 
that things are slower because ISPB is a slower connection. This means the 
default gateway would have to change on the fly and I can't seem to locate much 
information on how this can work.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,&nbsp;John&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Nick wrote:</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=3>DATE: 
10/25/2000&nbsp;19:58:00<BR>SUBJECT: RE:&nbsp; Multipath 
natd</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;<FONT face=COURIER>n Wed, 25 Oct 2000, John 
Prince wrote:<BR><BR>&gt; Hello..<BR>&gt; Is it possible (I have been 
trying)....<BR>&gt; I have noticed other requests, however there does not seem 
to be any answers..<BR>&gt; <BR>&gt; I have a firewall setup, IPFW and Natd, 
with 2 external interfaces, and a <BR>&gt; single internal.<BR>&gt; Each 
external interface is connected to a provider.<BR>&gt; Setup is as 
follows..<BR>&gt; External Internal.<BR>&gt; bbb.bbb.bbb.bbb 
---------------<BR>&gt; |--------------- ccc.ccc.ccc.ccc<BR>&gt; aaa.aaa.aaa.aaa 
---------------<BR>&gt; The internal network consists of 2 nets, 10.0.1.0 and 
10.0.2.0<BR>&gt; What I want to do is route any traffic from the 10.0.1.0 
network to the <BR>&gt; (bbb) external<BR>&gt; interface, and traffic from the 
10.0.2.0 to the the (aaa) interface..<BR>&gt; Ipfw and Natd appear to function, 
as long as I specify a default route..<BR>&gt; I would like to do this all on a 
single machine, if possible..<BR>&gt; Any help would be greatly 
appreciated..<BR><BR>	It`s possible.&nbsp; Run 2 differnet natd`s.&nbsp; Setup 
ipfw like so:<BR><BR>	#Don;t Divert local traffic<BR>	ipfw add 50 allow ip from 
10.0.1.0/24 to 10.0.2.0/24<BR>	ipfw add 51 allow ip from 10.0.2.0/24 to 
10.0.1.0/24<BR><BR>	#Dvert traffic from 1.0/24 out and in interface B<BR>	ipfw 
add 100 divert natd ip from 10.0.1.0/24 to any<BR>	ipfw add 101 divert natd ip 
from any to any in via $INTERFACE_B<BR><BR>	#Divert traffic from 2.0/24 network 
in and out int a<BR>	ipfw add 200 divert natd2 ip from 10.0.2.0/24 to 
any<BR>	ipfw add 201 divert natd2 ip from any to any in via 
$INTERFACE_A<BR><BR><BR>	#Add routing for these natd`d addresses<BR>	ipfw add 
1000 fwd $INTERFACE_B_NEXT_HOP ip from <BR>	$INTERFACE_B_ADDRESS to 
any<BR><BR>	ipfw add 2000 fwd $INTERFACE_A_NEXT_HOP ip from 
<BR>	$INTERFACE_A_ADDRESS to any<BR><BR>	#Leave on for testing until it 
works<BR>	ipfw add 3000 allow ip from any to any<BR><BR>	Then after you do that 
setup the 2 different natd`s to listen on<BR>	different ports (default 8668) and 
another entry 
int<BR>	/etc/services:<BR><BR>		natd2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
8669/divert # Network Address Translation<BR><BR>	Then run the nat`s 
seperately:<BR><BR>		root# natd -p 8668 -a $INTERFACE_B_ADDRESS<BR>		root# natd 
-p 8669 -a $INTERFACE_A_ADDRESS<BR><BR><BR><BR>Nick Rogness<BR>- Drive 
defensively.&nbsp; Buy a tank.<BR></FONT></DIV></FONT></BODY></HTML>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002601c03fa5$a760da30$0100000a>