From: "Steven N. Fettig" <[EMAIL PROTECTED]>
To: Travis Troyer <[EMAIL PROTECTED]>, FreeBSD - questions <[EMAIL PROTECTED]>
Subject: Re: 3 Nics - Dual (Tripe) Homed Host
Date: Mon, 10 May 2004 09:55:46 -0500

Travis Troyer wrote:

I have a FreeBSD system that acts as a NAT Gateway, currently providing on LAN with access to the Internet. I have added a third NIC, connected to a second LAN. The second LAN does not need internet access, but I would like it to be able to communicate with the first LAN. I have tried reading various sources, but have not found anything dealing with this situation. I would appreciate any help. Below is a diagram of my current setup and the output of ifconfig.

                [ xl0: DHCP assigned ]
                            |      |
            [ xl1:]  [ xl3:] LAN LAN

Output of ifconfig:
       inet netmask 0xffffff00 broadcast
       ether 00:60:97:74:35:b0
       media: Ethernet autoselect (10baseT/UTP)
       status: active
       inet netmask 0xffffff00 broadcast
       ether 00:01:02:37:93:eb
       media: Ethernet autoselect (100baseTX <full-duplex>)
       status: active
       inet netmask 0xffffff00 broadcast
       ether 00:01:02:cc:63:d2
       media: Ethernet autoselect (100baseTX <full-duplex>)
       status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
       inet netmask 0xff000000


Although I have been dealing with routing for years, I can't claim I really understand it well, so my advice may not be so intelligent, but here's a stab at it anyway:
I think what you want to do is to bridge both LAN's. You need to tell your gateway that in order to get to from, you need to tell the routing tables that the route to is via xl1 and vice versa.

route add -interface xl1

and vice versa:

route add -interface xl2

In the handbook, it says (
<--begin quote-->
19.5.4 Enabling the Bridge

Add the line:

to /etc/sysctl.conf to enable the bridge at runtime, and the line:,if2

to enable bridging on the specified interfaces (replace if1 and if2 with the names of your two network interfaces). If you want the bridged packets to be filtered by ipfw(8), you should add:

as well.

For FreeBSD 5.2-RELEASE and later, use instead the following lines:,if2
<--end quote-->

I am not sure if this will work, though, because I'm not sure what effect (if any) it would have on the NAT from the network. You might want to first try this approach while NAT and the firewall are turned off. I have a similar situation that I want to test, so I'd be curious if you succeed and how.

Steve Fettig


Thank you for your suggestion, however, I gave that a try, and really wasn't getting anywhere. For the sake of not angering the roommates too much by having to disable NAT, I tried every option but that. In my research I found out about Virtual Hosts, or IP aliasing, and, since there were only two machines on the network that needed to access machines on the network, and they were both running FreeBSD, I simply gave each machine a second IP on the network, and everything is working fine. In case you're interested, I used this bit of information:

I'm not sure if you were aware of aliasing, as I was not, or if this fits your situation as well as it did mine. I'm curious now as to whether or not my gateway/router machine could still provide connectivity between the two networks, via the virtual hosted interface, for clients on both LANs. Though my setup suites me now, I may give that a try.


Travis Troyer

MSN Toolbar provides one-click access to Hotmail from any Web page FREE download!

[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to