Path: fwi.uva.nl!sun4nl!EU.net!howland.reston.ans.net!usc!hookup!news.mathworks.com!uunet!juniper.almaden.ibm.com!trall.almaden.ibm.com!trall From: trall@trall.almaden.ibm.com (Tony Rall) Newsgroups: comp.os.os2.networking.tcp-ip Subject: Re: TCP/IP over Ethernet? Date: 20 Feb 1995 04:56:27 GMT Organization: IBM Almaden Research Center Lines: 191 Message-ID: <3i97dr$fm0@juniper.almaden.ibm.com> References: <3i8mu6$121q@hearst.cac.psu.edu> Reply-To: trall@almaden.ibm.com (Tony Rall) NNTP-Posting-Host: trall.almaden.ibm.com In article <3i8mu6$121q@hearst.cac.psu.edu>, Patrick Wang wrote: >We're having trouble getting a little 'network' operational. We have a >computer acting as a router -> PPP connection to Penn State. That's fine. We >have another computer networked to the router, but how do we get it to work? >We've installed LAPS and messed with ARP and the routing tables for numerous >hours to no avail. What should the routing tables look like? The usual problem in these cases is that the router at the other end of the serial line does not know you have your own little subnet. Thus, even though you can get your lan packets to him, he'll never send anything back to your lan machines. Now you're in for the full treatment: Routing for OS/2 TCP/IP (Wherever "SLIP" is indicated below, any supported point-to-point protocol could be substituted. From the routing standpoint, it makes no difference.) In the examples below, IP addresses are shown using the following shorthand: L1 = IP address for interface 1 on subnet L. For example, if the subnet address is 128.1.2.0 (subnet mask = 255.255.255.0), the IP address would be 128.1.2.1. Interfaces and addresses ------------------------ Machines don't have IP addresses - interfaces do. If you have a machine with two LAN interfaces, you should have two IP addresses. Normally these addresses would be on different subnets. Point-to-point interfaces are an exception to this addressing rule - the address used can match one of the machine's other addresses. And the address of the other end of the link doesn't even have to be on the same "subnet". Also, you do not need to add routes for destinations that are defined by your interfaces. For example, if you have a SLIP connection defined as: ifconfig sl0 S1 S2 no routing definition (a "route add" command) is needed for S2. Some SLIP routers do not have IP addresses for their SLIP interface. They do, however, have addresses for any LAN interfaces that they have. Remote OS/2 machines require that their SLIP interfaces be configured with a target address; thus it is necessary to either find out the router's LAN address or make up an address. In the latter case, I suggest an address like 172.1.1.1 (which will not be used by anyone on the connected Internet); also, you will not be able to send packets with the router as the destination (i.e., you won't be able to ping the router), but you will be able to send packets through the router to some distant destination. Names and addresses ------------------- Routing is only concerned with IP addresses (such as 198.79.74.5) and not IP names (such as www.ibm.com). Nameservers (or HOSTS files) are used to translate between names and addresses. If you start with an IP name, it will always have to be converted to an address (since that is what routing requires). If you start with an address, the name may not be required, but some applications require that it be possible to perform the reverse translation from address to name. But again, that isn't a routing issue, and names will not be mentioned in the rest of this discussion. Where routing is configured --------------------------- Most, if not all, of the changes suggested below for SETUP.CMD and TCPSTART.CMD (these are in the TCPIP\BIN directory) can be accomplished by completing the Network, Routing, and Autostart sections of the TCP/IP configuration notebook (TCPIPCFG.EXE) rather than simply editing the indicated files. Routing on a machine with a single interface -------------------------------------------- --------------- LAN | | | L1 L2 L3-----other subnets router * Static routing Simple, cheap, but no recovery from router failure. In SETUP.CMD, for machines such as L1 and L2, add: route -f add default L3 1 The network administrator should provide you with the router's IP address. * Dynamic routing Not very complicated, some cost (requires another process (demon) running on your machine that listens for certain broadcast packets), can provide automatic recovery from router failure and configuration changes. To use this, at least one router on your network must also support RIP, a routing protocol most commonly used on end-user networks. In TCPSTART.CMD, add (or uncomment): start routed -q or (to avoid having the demon's window appear on your screen): start /min routed -q or (to avoid routed even showing up in your window list): detach routed -q You don't need any route statements in SETUP.CMD. Routing a LAN via SLIP to the internet -------------------------------------- --------------- LAN | | | SLIP link L1 L2 L3/S1-------------------S2/I1---(the internet) In this setup, the administrator of the S2/I1 machine (usually a commercial Internet provider) must be aware that you have a "network" at your end of the SLIP link and not simply a single machine. That administrator usually must assign you the local network address (L) that you will be using (as well as the SLIP addresses (S1 and S2). In some cases, the SLIP addresses will be handled dynamically; this would usually be handled in SLIPUP.CMD, rather than in SETUP.CMD, on L3/S1. (I hope that the LAN addresses, L1, L2, and L3, are not dynamic - I wouldn't know how to handle that.) * The non-SLIP LAN machines (L1, L2) In SETUP.CMD, add: route -f add default L3 1 * The SLIP-LAN machine (two IP addresses: L3 and S1) In SETUP.CMD, add: route -f add default S2 1 In TCPSTART.CMD, you may need to start routed (but without the "-q" option) - see below: start routed * Routing required on the "internet" side The S2/I1 machine must do something to enable itself and other internet machines to be aware of the L network: - Use dynamic routing. If L3/S1 runs routed (without the -q (quiet) option), S2/I1 can run routed or gated (preferably quietly) to listen for the routing broadcasts from L3/S1. - Use static routing. L3/S1 need not run routed (and some traffic on the SLIP link is avoided). A network route (on S2/I1) is needed to the LAN: route add net L S1 1 Routing a LAN machine via SLIP to a home machine ------------------------------------------------ SLIP link S1-------------------S2/I1---(the office network) home office In this setup, the administrator of the office network must provide you with your IP addresses. You need at least 3 of them: S1, S2, and I1. Ideally S1 and S2 will be on a different subnet than I1 - ask for this configuration. If your network administrator will only provide addresses in the same network, you must use the "proxy arp" solution below. * The home machine In SETUP.CMD, add: route -f add default S2 1 * The office (SLIP-LAN) machine * Routing to a SLIP subnet You simply must be running a routing protocol out the LAN (I1) interface. In TCPSTART.CMD, you need to start routed (but without the "-q" option): start routed * Proxy arp solution - no separate SLIP subnet In this case, all of the IP addresses (S1, S2, I1) that you've been assigned are on the same subnet. Normal routing techniques will not work because the S1 address (no other LAN machine needs to talk to S2) is not physically on the same network as I1. So we try to use a technique called "proxy arp": the office machine will respond on the I network to arp queries for S1 with its own adapter address. First you have to determine the LAN adapter address of the I1 interface. Issue "netstat -n" and copy the displayed "physical address" for the I1 interface. In SETUP.CMD, after the "arp -f" statement add: arp -s S1 12:34:56:78:90:12 pub where 12:34:56:78:90:12 is the adapter address of I1. This tells TCP/IP that when it receives an arp message for IP address S1, that it should respond with its own adapter address. Thus other machines on the I subnet, when wanting to send to S1, will actually transmit to I1. The S2/I1 machine should forward the packet over the SLIP link to S1. -- Tony Rall trall@almaden.ibm.com