Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: Trouble with Ethernet Message-ID: <9473@brl-adm.ARPA> Date: Thu, 24-Sep-87 12:47:10 EDT Article-I.D.: brl-adm.9473 Posted: Thu Sep 24 12:47:10 1987 Date-Received: Sat, 26-Sep-87 17:06:44 EDT Sender: news@brl-adm.ARPA Lines: 127 It appears that the problem is that the Vax (and the PCs) have internet addresses 126.1.0.*, whereas the Sun (and its client) have addresses 192.9.200.*. (These aren't properly assigned internet addresses, but we aren't connected to the internet.) It appears that both the Sun and Vax believe that all hosts on a single Ethernet have the first three parts of their addresses the same. Thus, the Sun refuses to put packets on the net for addresses other than 192.9.200.*, and the Vax refuses to put packets on the net for addresses other than 126.1.0.*. Thus, the Sun and Vax can't talk to each other, and a PC can talk to only one of the two at a time (depending on the address that the PC is set to respond to). There seem to be two possible solutions: 1. Change the addresses of the Sun (and its client diskless Sun) to 126.1.0.* addresses. 2. Get the Sun and the Vax to understand that both sets of addresses are physically on the same Ethernet. (Since they are both BSD 4.2 versions, the same fix should work for both.) Well, that reminds me of a war story. We went from a Class C net (192.12.119.xx) to a Class B net (129.6.xx.xx), subnet 48. We have Vaxen running 4.2 and 4.3, a Sequent running Dynix V2.0.1, and various Sun-2's and Sun-3's running anything from 2.0 to 3.2. Only 4.3 has the `netmask' parameter, altho I think it appeared in Sunix 3.4. Everything seemed to work, except the 4.2 Vaxen. My first clue was when netstat -r left off the chars enclosed in <<<>>> below: Routing tables Destination Gateway Flags Refcnt Use Interface 127.0.0.1 127.0.0.1 UH 1 157 lo0 129.6.48.154 127.0.0.1 UH 0 3655 lo0 default 129.6.48.1 UG 0 10781 il0 129.6<<<.48>>> 129.6.48.154 U 2 151992 il0 I figured it had something to do with Marxism (class struggle :-), and found the specific code, in /sys/netinet/in.c. Fortunately, all we had to do was #ifdef out an `if' clause of two. Our changes are only the `#' lines. #define FORCE_CLASS_C 1 /* * Formulate an Internet address from network + host. Used in * building addresses stored in the ifnet structure. */ struct in_addr if_makeaddr(net, host) int net, host; { u_long addr; if (net < 128) addr = (net << IN_CLASSA_NSHIFT) | host; #ifndef FORCE_CLASS_C else if (net < 65536) addr = (net << IN_CLASSB_NSHIFT) | host; #endif else addr = (net << IN_CLASSC_NSHIFT) | host; addr = htonl(addr); return (*(struct in_addr *)&addr); } /* * Return the network number from an internet address. */ in_netof(in) struct in_addr in; { register u_long i = ntohl(in.s_addr); if (IN_CLASSA(i)) return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); #ifndef FORCE_CLASS_C else if (IN_CLASSB(i)) return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT); #endif else return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); } /* * Return the host portion of an internet address. */ in_lnaof(in) struct in_addr in; { register u_long i = ntohl(in.s_addr); if (IN_CLASSA(i)) return ((i)&IN_CLASSA_HOST); #ifndef FORCE_CLASS_C else if (IN_CLASSB(i)) return ((i)&IN_CLASSB_HOST); #endif else return ((i)&IN_CLASSC_HOST); } Originally, we tried always forcing Class C, but it turns out there *is* one Class A address we're interested in: 127.0.0.1, AKA localhost. Interestingly enuf, it seems that Sunix and Dynix do this also (we don't have Sun source; we do have Dynix, but it's offline so I can't check). Thus, these systems DO THE RIGHT THING FOR THE WRONG REASON!!! They seem to be FORCING CLASS C MODE!!! The reason it's the right thing to do is that people seem to run on subnets anyway. I don't know what the gateway does, or how it's set up, but it's a Vax 750 running 4.3. But to get back to the original poster's question, my recommendation would be to run your network on a Class C net. That is, the first number should be 192 or higher, change the Vax and the PC's to use the same network number as the Suns. Comments anyone? Apologys to those of you who have to see this twice, but I wanted a wider audience. Special apologys to Chris and my bro, who have to see it three times, and to Bill Majurski (also of NBS), who had to live thru it. Dale Worley Cullinet Software ARPA: cullvax!drw@eddie.mit.edu UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 I'll show you MY telex number if you show me YOURS...