Subject: Multiple default routes through different network interfaces?
To: None <port-i386@netbsd.org>
From: Alicia da Conceicao <alicia@cyberstation.ca>
List: port-i386
Date: 10/22/2001 15:29:04
Sorry to bother everyone again, but I was wondering if it is possible
for a single NetBSD server to have multiple defaults routes on different
network interfaces, that each have their own separate gateways?

I have a PC running NetBSD-1.52, with two interfaces, each connected to
a different ISP, and each with unique static IP number from the ISP's
distinct network.  Neither ISP knows about the other, and neither ISP is
willing to change their routers to route traffic for the other ISP's
network.  The NetBSD-1.52 server has a kernel compiled with the GATEWAY
option for packet forwarding.

My goal is to have the following:

1) an incoming connection from a client computer with an arbitary IP number
        on the Internet to the static IP of one of the interfaces on the  
        NetBSD server, has all responses for that connection routed back
        via the same interface and the gateway that corresponds to that
	interface

2) an outgoing connection from the NetBSD server to a client computer
        with an arbitary IP number, can be routed via either interface
        in a round-robin fashion, preferable with some type of interface
        weight value that can be adjusted dynamically

Cisco routers can do this, and so can Linux servers using a pseudo network
interface, similar to the CCD pseudo device, that "joins" two or more
real network interfaces into a pseudo network interface.  I would greatly
appreciate any assistance in finding a solution for this to work on NetBSD.

Would "routed" or "gated" help?  Remember that neither ISP is providing
RIP, or any other type of routing discovery service.

Thank you in advance.
Sincerely,
Alicia.

PS. I have appended an example of what I mean...

For example, if the NetBSD server is running the telnet service, and has
two interfaces "eth0" & "eth1", and are configured as follows:

eth0: inet 123.123.123.123 netmask 255.255.255.0 gateway 123.123.123.1
eth1: inet 231.231.231.231 netmask 255.255.255.0 gateway 231.231.231.1

And if that remote client computer has IP number 8.8.8.8

Then from the client computer:

        client> telnet 123.123.123.123

all packets between the client & NetBSD server are routed only through
the eth0 interface and go through the 123.123.123.1 gateway.  And

        client> telnet 231.231.231.231

all packets between the client & NetBSD server are routed only through
the eth1 interface and go through the 231.231.231.1 gateway.

Also from the NetBSD server:

        server> telnet 8.8.8.8

all packets between the NetBSD server and client are routed entirely via
either the (eth0 interface + 123.123.123.1 gateway) or the (eth1 interface
+ 231.231.231.1 gateway), with a 50%-50% chance (or some other weight).