[lug] Linux SW router

John Hernandez John.Hernandez at noaa.gov
Mon Aug 6 15:12:40 MDT 2001


In the simple network you describe, you won't need to run any routing protocol (as implemented in gated, et al).  Assuming that you've already defined two networks A and C, the following should be done on node B:

1) Configure two interfaces, such as eth0 and eth0:0 in the case of a single NIC.
2) Assign IP addresses to each interface such that one is on net A and the other is on net C
3) enable IP forwarding on B (kernel parameter net.ipv4.ip_forward = 1)

Then make B the default route on both boxes A and C.

It's generally not trivial to automate the IF condition you present below, that is, change routing behavior depending on whether B is present or not.  You may be able to load gated and  run something like OSPF on all three machines and define virtual interfaces on all of them.  This gets a little ugly.  Other fancier solutions are possible, too.

-John


Melwyn Pereira wrote:
> 
> Currently, the Internet is not in this network as for now it should be a self
> contained
> (private network).
> 
> From the diagram below, option #1 is the goal and node B has ONE nic.
> Because node A, B &C are on the same subnet, I didn't setup another nic for
> node B.
> 
> The following 2 scenario's are my goals:
> 1) If node B exists in the private network, nodes A & C must send packets via
> node B.
> 2) If node B doesn't exist in the private network, node A & C can communicate
> directly
>     with each other.
> 
> "Holshouser, David" wrote:
> 
> > where is the Internet in this network?
> >
> > 1. not connected
> >     A <--> B <--> C (B has 2 nics?)
> >
> > 2. Inet <--> A <--> B <--> C (each machine has 2 nics?)
> > 3. Inet <--> A <hub> BC
> > 4. Inet <dslswitch/dhcp> ABC
> >
> > If you are shooting for option 3, then a router isn't necessary. Let linux
> > do masquerading for you and alls well. That's the most common thing I've
> > seen.
> >
> > > -----Original Message-----
> > > From: Melwyn Pereira [mailto:mpereira at its.bldrdoc.gov]
> > > Sent: Monday, August 06, 2001 1:09 PM
> > > To: lug at lug.boulder.co.us; ss2chef at yahoo.com
> > > Subject: Re: [lug] Linux SW router
> > >
> > >
> > >
> > >
> > > I'm trying to build a 3 node network in a peer to peer
> > > methodology. These
> > > nodes are on the same
> > > network. I understand that routers are for different networks
> > > but not sure
> > > what else to try.
> > >
> > > Problem:
> > > Currently, Node A communicates directly with Node C as they
> > > are all on the
> > > same network.
> > >
> > > Goal:
> > > Node A  < -- > Node B <--> Node C
> > >
> > > I am not running public IPs or NAT, etc.
> > >
> > >
> > >
> > > Stephen Smith wrote:
> > >
> > > > Tell us a little about your network.
> > > > Topology?
> > > > How many nodes?
> > > > Are your routing public IPs or will you be
> > > > running with private IPs with your device doing
> > > > some sort or masq or NAT?
> > > >
> > > > SGS
> > >
> > > _______________________________________________
> > > Web Page:  http://lug.boulder.co.us
> > > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

-- 

  - John Hernandez - Network Engineer - 303-497-6392 -
 |  National Oceanic and Atmospheric Administration   |
 |  Mailstop R/OM12. 325 Broadway, Boulder, CO 80305  |
  ----------------------------------------------------



More information about the LUG mailing list