Subject: Need help setting up a gateway
To: None <netbsd-help@NetBSD.ORG>
From: Trevin Beattie <trevin@xmission.com>
List: netbsd-help
Date: 11/19/1999 19:30:51
I've just installed a second network card in our company's server, and I
would like to get it set up so that one card is used for our internal
network and the other connects to our ISP through a frame relay.

The hardware is working fine; I have been able to get each card to handle
network traffic individually.  I have configured the kernel with the
GATEWAY option (recompile, install, reboot) and `sysctl
net.inet.ip.forwarding` comes up 1.  Then I connected one client machine up
to the second network card and tried to get it to see the rest of the network.

Here's the problem: If I configure the second interface with a completely
different network address (10.0.0.1) and the client machine to be on the
same address (using the server as a gateway), the client machine can see
the server, but can't get through to the rest of the network, and vice-versa.

This isn't a workable situation anyway, because the client machine is at
the wrong address.  What I need is to keep at its original address, because
eventually that interface will be going to our WAN router.  But when I
configure both interface cards to use the same IP address, then the client
machine always gets put in the routing table with the wrong interface, and
so nothing can talk to it.

Here's the specific configuration:

ep0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	address: 00:a0:24:a2:07:3c
	media: Ethernet 10baseT
	inet 192.77.10.202 netmask 0xffffff00 broadcast 192.77.10.255
ep1: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	address: 00:60:97:5f:35:70
	media: Ethernet 10base2
	inet 192.77.10.202 netmask 0xffffff00 broadcast 192.77.10.255
lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 32976
	inet 127.0.0.1 netmask 0xff000000
ipip0: flags=8010<POINTTOPOINT,MULTICAST>
ipip1: flags=8010<POINTTOPOINT,MULTICAST>

Routing tables

Internet:
Destination      Gateway            Flags
default          192.77.10.1        UG
192.77.10.0      link#1             UH
gateway.eyring.c 0:0:a5:c5:6e:0     UH
...
trevin.eyring.co link#1             UH
192.77.10.255    link#1             UH

I had "trevin.eyring.com" (192.77.10.241) connected to the second
interface, link#2, and had deleted it from the routing table, then tried to
ping the server from it.  That's when it reappeared in the routing table
under link#1.

So how can I tell NetBSD to route packets to this machine on ep1 instead of
ep0?

-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown