Subject: Re: Mofiying Kernel
To: Bill Studenmund <wrstuden@zembu.com>
From: Rajnish Madan <rajnishm@delhi.tcs.co.in>
List: tech-kern
Date: 12/19/2000 10:25:32
Hi,

After fighting two days with the NetBSD kernel, i have come with
following points :-).
Actually i want my Netbsd Server (acting as router) to able to forward IP
packets
for more than one IP addresses (other than which it owns also).

I set the ethernet card in promiscous mode using ioctl.
I built the server with GATEWAY options for ip-forwarding.

I  made some hardcoding in the if_arp.c to return the V-MAC1 for
IPA and VMAC2 for IPB, so was able to send the ARP requests with
VMAC1 and VMAC2 for IPA and IPB.

Now for the kernel to listen for packets for both IPA and IPB, i added
an if condition in elinkxl.c, that if the interface is in promiscous mode
then only send up the Broadcast, Multicast and packets ment for
VMAC1 and VMAC2.

After doing these modifications in the kernel. I was able to work normally
with
the IPA (ping, telnet..) also using IPB as the default route for some host,
i was able to
traceroute some other host, though in traceroute it showed first hop router
as IPA.

Doubts:
I want the control of the VMAC and IP to be dynamic, my application should
be able to direct the Kernel to cater to these scenario. How shall i go
about it.
I have some inputs that the ioctl need to be used in this regard, but i am
stuck-up as to how to do it....:-(

Pls suggest/guide in this regard
Thanks in advance
Rajnish