pv@uscvax.UUCP (Peter Vanderbilt) (09/30/85)
How can one explicitly route to certain hosts through a particular ethernet interface? At boot time on host usc-cse, we use ifconfig il0 -trailers arp usc-cse to initialize the interface and establish a uscnet-to-il0 route. At this time, communication to usc-cseb (on uscnet) works. BUT, if I try the simple experiment route add usc-cseb usc-cse communication between usc-cse and usc-cseb stops! (Using "telnet usc-cseb" results in an immediate "connection closed by foreign host"; this is without the "ifconfig il1" or any other Bnet routing, as discussed below). "Netstat -r" shows: Routing tables Destination Gateway Flags Refcnt Use Interface usc-cseb usc-cse UH 0 520 il0 loopback-net localhost U 0 10161 lo0 uscnet usc-cse U 1 378483 il0 Once the usc-cseb route is deleted, communication is restored. My suspicion is that an ethernet interface can't handle packets routed to it as a host (i.e. you can have networks and gateways as destinations but not hosts). What's going on? Any suggestions? (We have a VAX 750 running BSD 4.2 with two Interlan ethernet boards). Why do we want explicit routing? We want to use our VAX as a gateway between two ethernets. Unfortunately, for reasons beyond our control, we are not allowed to assign different Internet network numbers to the two ethernets (apparently we are not allowed to have a "remote" net behind the arpanet gateway). My plan is to route directly to all local hosts, on ethernet A, and then wildcard route to hosts on ethernet B and the rest of the world: # Name interfaces and remove default routings ifconfig il0 -trailers arp Anet-gw ifconfig il1 -trailers arp Bnet-gw route -f # route local hosts out il0 (net A) for host in <local-host-list> do route add $host Anet-gw done # route B hosts out il1 route add uscnet Bnet-gw # route the rest through gateway (brand on B) route add 0 brand . (Perhaps the order of routing calls needs to be reversed). Uscnet is 192.5.10 in /etc/networks and /etc/hosts has 192.5.10.255 usc-cse cse usccse csea usc-csea usccsea Anet-gw 192.5.10.248 usc-cse Bnet-gw 192.5.10.254 usc-cseb cseb usccseb 192.5.10.61 brand Are there other ways to accomplish the same thing? Other suggestions? Thanks. Pete -- Peter Vanderbilt uucp: ...!{{decvax,ucbvax}!sdcsvax,hplabs,allegra,trwrb}!sdcrdcf!uscvax!pv csnet: pv@usc-cse arpa: pv@usc-cse.csnet (or pv%usc-cse@csnet-relay.arpa)
chris@umcp-cs.UUCP (Chris Torek) (10/03/85)
I cannot say for certain that this is your problem, but I recall a bug
in the distributed 4.2 code. In netinet/ip_output.c, inside ip_output(),
if you have a bit of code that reads
if (ro->ro_rt == 0 || (ifp = ro->ro_rt->rt_ifp) == 0) {
error = ENETUNREACH;
goto bad;
}
ro->ro_rt->rt_use++;
if (ro->ro_rt->rt_flags & RTF_GATEWAY)
dst = &ro->ro_rt->rt_gateway;
change the last two lines to
if (ro->ro_rt->rt_flags & (RTF_GATEWAY|RTF_HOST))
dst = &ro->ro_rt->rt_gateway;
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP: seismo!umcp-cs!chris
CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu
ron@brl-sem.ARPA (Ron Natalie <ron>) (10/08/85)
> > route add usc-cseb usc-cse > > communication between usc-cse and usc-cseb stops! (Using "telnet usc-cseb" > > Routing tables > Destination Gateway Flags Refcnt Use Interface > usc-cseb usc-cse UH 0 520 il0 > loopback-net localhost U 0 10161 lo0 > uscnet usc-cse U 1 378483 il0 > > Once the usc-cseb route is deleted, communication is restored. My suspicion > is that an ethernet interface can't handle packets routed to it as a host > (i.e. you can have networks and gateways as destinations but not hosts). The way the routing table works is that you give the HOST ADDRESS for the next HOST (i.e., the gateway) that is to receieve packets bearing the ADDRESS of DESTINTATION. What you've done is create a loop. Your machine will send all the usc-cseb packets to itself continually. > Why do we want explicit routing? We want to use our VAX as a gateway between > two ethernets. Unfortunately, for reasons beyond our control, we are not > allowed to assign different Internet network numbers to the two ethernets > (apparently we are not allowed to have a "remote" net behind the arpanet > gateway). Why not check out the 4.3 Subnet code. This is probably closer to what you want. Or work on some more dedicated Gateway/ARP code. -Ron