IMPORTANT! From now on, the FORMAT OF /ETC/DIPHOSTS file is CHANGED!! Two new fields are added, they are: - local IP address (or hostname) - local netmask So from now on, /etc/diphosts will look like: user : password : remote host : local host : netmask : comments : protocol,MTU Fields "local host" and "netmask" can be empty, but THEY MUST BE THERE! Example: fool::makaka:::Silly DIP client:SLIP,296 smart::ass:istant:255.255.0.0:CSLIP,296 great:s/key:ass:istant:255.255.0.0:CSLIP,296 Also, please DON'T pester Fred van Kempen with questions about this version of DIP, OK? Also, please note: my experience shows smaller blocks (i.e. smaller MTU) work BETTER. You *can* define MTU 1500, but it won't vouch for your sanity. I somewhat modified this package, adding support for a few commands: 1. quit - this was needed to prevent DIP from just dropping the tty device in some weird state, in case it couldn't succeed establishing connection (like, the phone was busy). 2. netmask xxx.xxx.xxx.xxx - obviously, if you have some specific netmask in mind, you put this into your profile... Otherwise it won't specify "netmask ..." in it's "ifconfig" and may G-d help you. 3. default - this tells DIP that it should set up the default route to the remote host it made a connection to. If this command isn't present in the command file, default route won't be set/changed. 4. exit - not really needed, just for the cleanness of the script... Instead of just falling through the bottom, you can use this command and it will nicely exit leaving established [C]SLIP connection intact and running. I didn't add the code for this command, just spotted it in the source (:-). Also, Pauline added error code to this command, so "exit 4" should return exit status 4... You got the idea, right? (:-) 5. Added "tty_notlocal()" call (provided by Rob Janssen) and a few other patches by him (after some verification and clean-up). 6. Now DIP server behaves somewhat differently from DIP client, and it improves the reliability somewhat. It means, there are essentially two "tty_notlocal()" thingies in the code, one for user-requested hangup, and the other for line drop. 7. A few patches, by Erik Olson, Neal Becker, Rob Janssen, Michael N. Lipp, Joerg Schlaeger, probably some others I was too silly to record (and I apologize for that!). 8. This DIP is now S/Key-capable. I'm adding some S/Key sources in here, but retrieve the whole package, just to be safe. 9. IP address can now be assigned either by user login name, or by tty line the call came in. If the user login name is "ttyS1", for example... See below for a brief explanation/example how to use it. 10. Locking mechanism was changed a little - now it's supposed to detect if somebody else holds the lock on the tty line and leave it alone in that case. 11. An option "-l ttySn" was added, so you can specify what DIP exactly you want to kill. If you didn't use this flag, DIP will kill the last started DIP. 12. Quite a few upgrades by Bill Reynolds, Pauline Middelink, Paul Cadach...If I missed you, a nice contributor - please forgive me! It's not because of lack of appreciation! Also, thanks to Daniel Suman for quite a few bug fixes, and help debugging the thing. Oh, Pauline's patches add the ability not to have DIP users listed in /etc/passwd file at all, being completely defined in /etc/diphosts, a-la taylor UUCP... I don't like it, but if you want it, you get it. 13. Please note, "dial" command in DIP script is slightly different now - it "eats" the string the modem responds with to your dial! Thus, DON'T expect "CONNECT" after successful dial, not any more. Instead - check "$errlevel" value, just like this: dial 555-1212 if $errlevel != 1 goto error Note, that standardly, 0 - OK 1 - CONNECT 2 - ERROR 3 - BUSY 4 - NO CARRIER 14. VARIABLES. Please note, that "$locip" was designed to retrieve local IP address (dotted decimal notation), and "$local" was designed for host name *or* IP address... It's hoped, that when you do "get $locip ..." it will skip over all the crap until it hits something that looks like dotted decimal notation. Maybe it's not working yet in this release, but it's how things are designed to work, and thus how they certainly will, at some point. TAKE A LOOK at "sample.dip" file - it's there for a purpose. (:-) SAME IS TRUE for "diphosts". ALSO, PLEASE IGNORE MOST OF THE HOWTO AND SUCH: THEY'RE HOPELESSLY OUT OF DATE. I'm not sure Fred will support these changes of mine, nor can I guarantee I didn't introduce new bugs with my patch. Use it on your own risk. At least it works for me, for Compressed SLIP with MTU 296 and a LOT of remote X11 and FTPing and so on. Enjoy! uri@watson.ibm.com DYNAMIC IP ADDRESS ALLOCATION. Oh, before I forgot: here's how to use dynamic IP address allocation: DIP-3.3.7-uri supports dynamic IP address allocation. That means in uri-speak, that IP addresses are allocated for tty lines, not for users (or rather, that you can have at the same time *BOTH* per-user IP address allocation and per-line IP addr allocation). So the IP address you get, dynamically depends on what line you happen to catch (:-). How does it work? Simply by the way you configure your DIP server, via "/etc/diphosts" file. 1. First put there all the entries for per-user IP addr allocation (maybe zero entries?). 2. Then put in all the entries for per-line IP allocation. Thus, if you have two incoming tty lines (two modems) and want to have two IP addresses for them, you'd put in a user "/dev/ttyS1" and "/dev/ttyS2"... DIP-3.3.7d and up will allow you to put in "ttyS1" and "ttyS2" (without that slash :-). 3. Don't forget to put in all the info - local_host (what your server looks like for those incomers) and for your own sake - try to make this local_host DIFFERENT from your Ethernet/Token Ring/FDDI/whatever other IPs your host may have; - remote_host (what IP address you grace them with); - netmask (rather useful) - of course, protocol (SLIP, CSLIP) and MTU. But that's trivial... 4. You're all set. Now you add those users who are supposed to be allowed to dial in, into your "/etc/passwd" (well, the standard procedure - I'm sure you know how to do that, and if not, you aren't qualified to run a SLIP server :-), and put "/usr/sbin/diplogin" as a shell for them. 5. Example: user "fred" should be allowed to DIP in, and should get line-based IP address. There are only two modems, for example, thus at most two lines incoming. The user name/login name is "fred", the "ttyS1" line should have server IP address 43.65.86.23 and remote end should get IP address "3.4.5.6",and the "ttyS2" line should be server "43.65.86.33" and it's remote end should get "4.5.6.7" IP addr. Then "/etc/passwd" will have an entry: fred:*:1976:96:Inbound SLIP:/tmp:/usr/sbin/diplogin And in the "/etc/diphosts" the last two entries will be: ttyS1::3.4.5.6:43.65.86.23:255.255.255.0:Modem 1 incoming SLIP entry:CSLIP,296 ttyS2::4.5.6.7:43.65.86.33:255.255.255.0:Modem 2 incoming SLIP entry:CSLIP,296 #if 0 This is the last version of DIP using the "/etc/diphosts" file. It has been updated to use the "databits" serial patches, the "speed" setting bugfix, Jim Seagrave's "echo" and "init" adds, and Paul Mossip's "dynamic address" patches, as sent to me by Jeff Uphoff. Here is his README: ----------------------------------------------------------------------------- For those of us that have our SLIP IP addresses assigned dynamically, here is a patch for dip that will trap the address when the remote host 'displays' it. (This is an option--those that don't want this need not enable it.) The meat of this patch was written by Paul Mossip (mossip@vizlab.rutgers.edu) Someone mentioned the existance of his patch, so I emailed him requesting a copy and he anonymously ftp'd it into my linux box. I have been using it heavily for several days now, and it works beautifully. Bravo to the author! (And many thanks) I extended his patch a slight bit; whenever I initiated a slip connection, dip executed a 'route' command that assigned the remote machine's IP address as both my Destination net/address and my Gateway address. My connection would not function unless I deleted that route and created a new one specifying my Destination net/address as 'default'. I have added 'default' to the set of commands that dip accepts-- if you use it, your Destination net/address will be set to 'default', if you don't use it, dip sets up the route as it did before. (This command, like the ones that Paul added, can either be entered in dip's command mode, or read in from a script file.) The abilites that Paul's patch added to dip allowed me to totally automate my SLIP connections, with the exception of the routing change. This patch has taken the last step; everything is done from a script file and I haven't had a problem with the address assignment trapping once. Those that have to deal with dynamically assigned IP address will find this very useful. Thanks once again to Paul Mossip--he put all of the real work into this patch. ----------------------------------------------------------------------------- The next release of DIP will use a much more powerful scripting language (derived from the Minicom communications package), and it will use the "/etc/diptab" "termcap"-like database for its client hosts. This will allow for a much more flexible setup of hosts, and it will allow me to implement a Dynamic Address Server for DIP, making it usable as a "real" SLIP/PPP dialin server. Fred, 07/20/93 #endif