network question

Paul Civati paul at
Wed Aug 30 17:09:07 BST 2000

David Richards <davidr at> wrote:

>    I have two network cards in a machine. ed1 is connect to the main
> network and ed0 connected to a test network. how can i add routes to
> ed0 so that it will pass all traffic over to ed1 and the other way
> around? so in theory. i should be able to logon to the test network
> and ping etc... any workstation on the main network and the other
> way around too?

A few routing concepts to start with:

 - A router is a box with more than one interface, and all it does it
   forward packets between those interfaces.  (Providing that a) it
   has the relevent routes in its routing table so that it knows
   where to send packets to and b) it has IP forwarding enabled).

 - A router can route to a network it has an interface on without
   needing any specific routes added, because it knows how to reach
   those networks by virtue of being directly connected to them
   (aside, Linux *does* require routes to its interfaces, which
   I've always found a bit weird).

 - A router can only reach another network by having an interface
   on that network, or having a route to that network (and the
   route must point to a host it knows how to reach via one of
   its interfaces).

Machines on your main network (call it will (I
guess) have default routes pointing to your internet connection
router (call it

This new router of yours will have two interfaces, call the one
on the main network, and the other test network
will be
  Internet ----------------- New -------------------- Test
     G/W                     G/W                      Host
            Main network              Test network

When a host on your main network needs to talk to
it will send packets using its default route to,
so on your internet gateway you will need a route to say that to
reach it should send packets to

  route add -net 192.168.50 -netask

or similar Cisco speak:

  ip route

On your test network hosts will have a default route of, and your new gateway will want a default route
of so that it knows how to get out to the internet.

This is a difficult subject to explain in this medium, but I
hope the above is explanational without being more confusing. :)


More information about the Ukfreebsd mailing list