This is the fast route to a single host on the network. More complex issues are not covered. The networking programs are on the Slackware-N disk set, and elsewhere on the CD's.
/var/adm/setup/setup.netconfig, may help you establish an initial configuration, (or destroy any existing configuration). Other utilties like linuxconf, may or may not help.
There are different types of account. I have an account that gives me a static IP address, and hostname.
Some sites may give you a dynamic address (man dip, wait string ; get $remote), which is not what you want.
Some accounts don't register your machine on the Internet, only your email name on their machine. These are a good idea for DOS, but won't help you learn much except about that particular system.
You will probably get a choice of PPP or CSLIP, which may be with optional security features (which repeat the password identification step with a second password, but sent as part of the PPP protocol.
You will be collecting mail by SMTP.
Your ISP will tell you:
You MUST substitute your values into these scripts. Using my ISP's nameserver for your requests won't make me popular, and may or may not work, depending on whether the ISP checks who made the call, and whether it advertises the outside to the outside.
In pariticular, I don't want to receive your mail!
This is to help you decide what the manuals are talking about. I presume you are connecting to your Internet Service Provider using SLIP (or CSLIP). If you are using PPP see the PPP HOWTO.
PPP is very similar, but traditionally uses chat instead of dip. The HOWTO's describe dialing IN as well as out. Don't get frightened by that! Internal modems are the same as external modems, but appears as an additional UART chip on the machine.
Your ISP will allocate you a static IP address, unless they chose to use dynamic addresses. eg universities allocate an IP address to the modem, and you could get one of 10 modems when you call. This means you don't know YOUR IP address, until you connect, and it is only valid for that session.
ls -l /dev/modem # -> cua2 setserial /dev/modem # 16550A setserial /dev/modem irq 5 spd_vhi stty crtscts < /dev/modem
Connect to a local BBS using minicom. This shows that the hardware is working, and makes you feel better if nothing else works. My ISP allows 'demo' login on the same phone number to welcome new users without accounts, for testing the line, and for downloading (DOS) connection shareware.
I keep trying to put a different name in here, so that I can boot as raven, or as a different name (selecting a different configuration in /etc/rc.d/rc.*), but sendmail keeps refusing to allow me to do so. In the mean time, I use the 'one-true-name' of my Intenet connection.
trix.dircon.co.ukYou would of course substitute your hostname here, and everywhere else. Ditto for the other parameters.
You MUST edit this to be YOUR addresses and names. chmod 644, chown root. It must be world readable, but not writable. You should check its contents regularly, as it is a lock (one of many) needed to keep the system secure. Check also the permissions on /etc/.
The first name on a line is the 'proper' name. Note that trix has two lines, one for the ethernet card, one for the slip link.
Putting nameserver here is of no benefit except for ping.
# /etc/hosts # loopback 127.0.0.1 localhost # lan_67 the ethernet LAN 192.168.67.1 trix.dircon.co.uk trix.trix.org trix 192.168.67.2 crow.trix.dircon.co.uk crow.trix.org crow 192.168.67.3 kestrel.trix.dircon.co.uk kestrel.trix.org kestrel 192.168.67.6 pc_cube.trix.dircon.co.uk pc_cube.trix.org pc_cube 192.168.67.7 pigeon.trix.dircon.co.uk pigeon.trix.org pigeon 192.168.67.11 raven.trix.dircon.co.uk raven.trix.org raven # slip link to tdc 193.128.226.67 trix.dircon.co.uk tdc_me 193.128.226.1 tdc_gw.dircon.co.uk tdc_gw # number placed into /etc/resolv.conf 193.128.224.1 nameserver.dircon.co.uk nameserver # problems with name server during connection 193.128.224.10 mailhost.dircon.co.uk felix felix.dircon.co.uk # eof # /etc/hosts.
Check that it contains the following. Note that hosts comes before bind, this means that your /etc/hosts file 'knows better' than the network DNS service, and is checked first.
Personally I have a bug-ette where DNS does not work properly for the first few seconds until the name server connection 'warms-up'. My workaround, is to put the mailserver address in /etc/hosts, not get it from the dns. This also prevents delays when the network is down, and helps prevent a spoofing host from feeding me lies.
order hosts, bind multi on
You MUST edit this to have YOUR domain and nameserver. Use the information that your ISP sent you.
This is part of dns - how you automatically lookup the IP_ADDR of "rtfm.mit.edu", or any other site not listed in /etc/hosts.
If you connect to different ISP's at different times, simply move the correct file into place as part of the dip_in script.
domain dircon.co.uk nameserver 193.128.224.1
I want to rename this file to rc.eth0, which better describes its function.
Like the sl0 device, you can bring these up and down as you wish. Thick ethernet connections blow the transiever if you plug-unplug them with the power on, but thin ones, and TP don't.
The SLIP/PPP gateway and routing is done by the dip script, this file only effects the ethernet networking. Though setting the DEFAULT gateway here, would override the normal setting of using the ISP's gateway. ie when TCP/IP tries to send a packet to 101.202.033.123, if it isn't in one of the LISTED gateways, it goes to the default (Internet) gateway.
If you do have several LAN's (local ethernet), you could set up a list of static routes, at least on the gateways themselves.
# etc/rc.d/rc.inet1 # configures .eth0 HOSTNAME=`hostname` # Attach the loopback device. /sbin/ifconfig lo 127.0.0.1 /sbin/route add -net 127.0.0.0 # call /etc/rc.d/rc.eth0 # call /etc/rc.d/rc.eth1 # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the # eth0 interface. If you're only using loopback or SLIP, don't include the # rest of the lines in this file. # Edit for your setup. NETMASK="255.255.255.0" # MOST people use 24_8 bit IPADDR="192.168.67.1" # WANT to get from /etc/hosts NETWORK="192.168.67.0" # But then have to guess or calculate these BROADCAST="192.168.67.255" # Though default guess is 24_8 ! # configure eth0 as UP with address /sbin/ifconfig \ eth0 ${IPADDR} \ broadcast ${BROADCAST} \ netmask ${NETMASK} # tell route that it is there /sbin/route add -net ${NETWORK} netmask ${NETMASK} # tell route that there is a gateway out there # tell route that thet is THE gateway to EVERYWHERE (default) # The LAN gateway # GATEWAY="192.168.67.101" # REPLACE with YOUR gateway address! #/sbin/route add default gw ${GATEWAY} metric 1If you don't have an eth0 card, dont worry about this file. It will probably be OK (or generate eth0: errors once). Getting these parameters wrong won't disturb your Internet configuration, unless you are very unlucky.
Running the eth0 route default gw command whilsT the Internet connection is UP, would confuse you, as you want tdc_gw to be the default gw.
Then could then keep the default gw as tdc_gw, and tell route of a list of networks on your LAN's, and gateway(s) to reach them.
This file must NOT be world readable, as it contains the password to your Internet account.
tdc is the name of my ISP. To make life easier, I use two pseudonyms 'tdc_me' and 'tdc_gw' in /etc/hosts.
Copy and modify the example 'dip' script and write a shell script that calls it. My calling script wakes up my sendmail, and the ISP's sendmail.
When V34 modems CONNECT, they return the BAUD rate, reporting either the speed of the wire to the computer (DCE), or the speed of the phone (DTE).
The V34 modem gathers complete 'V34 packets' from the remote modem at 28.8k baud. It then checksums the packet before passing it to the computer at 115.2k (4 times faster).
With external modems this is a real 115.2 k baud signal, with start and stop bits, and a top speed of 11.5 k bytes per second.
With internal modems, the timing is still enforced, but really doen't need to be, as the card can run at full XT speed, in FIFO chinks of 16 bytes per interrupt (and subsequent bytes or groups in the same interrupt).
You should run once with (AT L0) so that it shows the DCE speed. This confirms that setserial really did work.
Then modify it to use L2, so that the modem reports the CONNECT speed. This varies beteen 28800 26400 24000, depending on luck.
Consult your modem manual for options.
For comparison figures, FTP often reports text file transfers at 4 K/s and compressed binaries at 2.5 K/s. It seems that the modem's compression doesn't improve on gzip, but helps a lot with text files.
If you use this script unattended, you MUST make it robust. I watch it run, and use CTRL-C (TWICE!) if it fails.
NOTE: You can't have comments on the same line as commands.
You will have to edit this.
---------------------------------------------------------------------- #!/sbin/dip # /usr/local/lib/tdc.dip ####### # label: first word on line # comments must be on own line # cmd # cmnt causes usage -1 ####### # wait string [ timeout ] # returns OK_ZERO # if $errlvl == 0 goto OK # if $errlvl != 0 goto TIMEOUT ####### # dial tel_string [ TIMEOUT ] # returns OK_ONE # if $errlvl == 1 goto CONNECTED # if $errlvl != 1 goto TIMEOUT # 1 - CONNECT # 2 - ERROR # 0 - OK ## BUT NOT CONNECT 28800/ARQ ####### main: echo on print DIP_SCRIPT ........ tdc.dip ........ get $local tdc_me.dircon.co.uk get $remote tdc_gw.dircon.co.uk netmask 255.255.255.0 # speed $speed # it does the setserial IOCTL # defaults if fails # cmnt # speed 0 # probably drops DCR ON_LINE -> ON_HOOK # # speed 9600 # BAUD # speed 19200 # 19200 # speed 38400 # 38400 -or- setserial /dev/modem spd_hi for 57600 # speed 38400 # 38400 -or- setserial /dev/modem spd_vhi for 115200 # speed exta # 19200 # speed extb # 38400 # speed 115200 # 115200 DIP does spd_vhi # tested # # speed 115200 # 115200/28800 = 11 kps / 2.8 = 4/1 # throughput calcs (in 1000 or 1024 - close to same) # 8 bit no parity 1 stop bit + 1 start bit = 10 bits per byte # # divide 10.1000 # 11.52 / 2.88 approx 4 times modem rate # divide 10.1024 # 11.25 / 2.8125 k-bytes # stty /dev/modem - has a POSIX limitation no named baud rate > 38400 # linux uses setserial spd_vhi (internal modem - as fast a bus) # DIP recognises problem and does the setserial # tested # # but comments on speed line cause another default to be used! # AT_OK Modem codes used ------------------------------ # AT Q0 V1 E1 X4 L2 W1 S95=47 M1 I4 \r # AT Q0 - enable result codes to be issued to the screen. # V1 - Result codes in verbal format not numeric # E1 - AT command line echo : on # X4 - monitor dial tones : all # L2 - speaker volume : 0,1,2,3 low,default,medium,high # W1 - error correction message shown in CONNECT line # S95=47 - CONNECT shows Extended Results. Selector codes # 01 - CONNECT shows DCE (spd_vhi) or DTE (modem-to-modem) # 02 - CONNECT shows ARQ - Automatic Repeat request # 04 - CARRIER XXXX # 08 - PROTOCOL XXXX # 32 - COMPRESSION # 47 = 32 + -- + 08 + 04 + 02 + 01 # 46 = 32 + -- + 08 + 04 + 02 + -- # M1 - Speaker On - until carrier detected # I4 - OEM-STR(28,800 BPS; V.34; 16FEB95; 1.021a) get_modem_lock: print DIP_SCRIPT getting UUCP device LOCK port modem speed 115200 expect_AT_OK: # reset # reset done by init str # want: detect modem line levels print DIP_SCRIPT looking for AT_OK modem # show DCE send AT Q0 V1 E1 X4 L2 W1 S95=46 M1 \r # show DTE send AT Q0 V1 E1 X4 L2 W1 S95=47 M1 \r send AT Q0 V1 E1 X4 L1 W1 S95=47 M1 I4 \r wait OK 2 if $errlvl == 0 goto got_a_modem print DIP_SCRIPT errlvl $errlvl modem_not_talking_to_me: print DIP_SCRIPT modem not talking to me print DIP_SCRIPT or not an AT_OK device goto error got_a_modem: print DIP_SCRIPT Modem online - ok # OK got a modem dial_and_connect: now_connect: # 0 - OK # 1 - CONNECT # 2 - ERROR print DIP_SCRIPT dial 0181-265-2211 - tdc Video Tron V34 dial 0181-265-2211 if $errlvl == 1 goto got_connect print DIP_SCRIPT errlvl $errlvl print DIP_SCRIPT MODEM <-- CONNECTED --> MODEM print DIP_SCRIPT Expecting login banner sleep 2 dial_failed: print DIP_SCRIPT Dial Failed goto error got_connect: ## DIP is not exactly bullet proof ## it was not reading text through properly ## stopeed using if errlvl codes ## so made simply a timeout ## ie hightly visible to operator ## echo on allows view of tty during login ## currently seen CONNECT: now_login_prompt: # wait login: 20 wait ogin: 20 if $errlvl == 0 goto got_login_prompt print DIP_SCRIPT errlvl $errlvl fail_no_login_prompt_timeout: print DIP_SCRIPT TIMEOUT(login) goto got_login_propmt # POSSIBLY UNSEEN goto error got_login_prompt: ------> send SLIP_LOGIN\n now_password_prompt: # wait Password: 20 wait ord: 20 if $errlvl == 0 goto got_password_prompt print DIP_SCRIPT errlvl $errlvl fail_no_password_prompt_timeout: print DIP_SCRIPT TIMEOUT(password) goto got_password_propmt # POSSIBLY UNSEEN goto error got_password_prompt: ------> send SLIP_PASSWORD\n # this is an optional switch for SLIP -or- PPP select # goto look_for_signs_of_succesful_login # goto now_enabled_sign now_protocol_prompt: wait Protocol: 20 if $errlvl == 0 goto got_protocol_prompt print DIP_SCRIPT errlvl $errlvl # goto error got_protocol_prompt: send SLIP\n look_for_signs_of_succesful_login: now_enabled_sign: # tdc says "Packet mode enabled" # grp fmt || fd=tdc # tdc says "Packet mode enabled..." # grp fmt || fd=tdc wait Packet 20 if $errlvl == 0 goto got_remote_SLIP print DIP_SCRIPT errlvl $errlvl got_enabled_sign: got_remote_SLIP: print DIP_SCRIPT Logged in to terminal sserver get $mtu 1500 route_before_slattach: default does_this_do_slattach: mode CSLIP # get $mtu 296 # 1500 is great for ethernet to backbone # try 296 for point to point # try V34 packet sizes +- compression, q depth, etc connected_to_slip: print DIP_SCRIPT CONNECTED $locip <---> $rmtip print DIP_SCRIPT /dev/$port at $speed baud goto exit_ok error: print DIP_SCRIPT errlvl $errlvl print DIP_SCRIPT ERROR - CALL ABORTED print DIP_SCRIPT /dev/$port at $speed baud print DIP_SCRIPT local $local $locip print DIP_SCRIPT remote $remote $rmtip print DIP_SCRIPT FAILED quit exit_ok: exit: exit ---------------------------------------------------------------------For some reason dip seems to require TWO CTRL-C's to exit. As will any script that calls it.
dip does the dialing, and it also does the ifconfig and route'ing.
You will need an extra few commands to tickle sendmail to life, and so-on. How you tell your ISP's mailhost (felix), to start email transmission will vary. Ditto for your self.
If you have smail, you need runq. If you have POP-3 mail you need something else. If you have a working news feed, you will also want to run procnews when the link is up, and maybe a batch-em-up script before the link comes up.
You might also want to connect WITHOUT transferring email, eg if you are booting a second test host, or if the transaction would take to long.
# dip_in # # see also /usr/local/lib/tdc.dip PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin: mailq # show mail that is queued to go out setserial /dev/modem # already done in /etc/rc.d/rc.local dip /usr/local/lib/tdc.dip 2>&1 | tee -a /tmp/dip_craps_out_$$ # || exit $? echo tail -1f /var/adm/messages & # shows all sorts of info sleep 2 # nameserver not debugged sendmail -q # send outgoing mail finger @felix # pull incoming mail # /usr/local/bin/procnews # pull news - if working finger @felix # confirm all received mailq # usually all sent by now
I only have one dip connection. You might have several, and be more selective about which you want to kill.
I don't like using the 'dummy' interface to prop-up a non-existent slip interface. I prefer to get 'network unreachable' errors, which is the correct diagnosis when the SLIP link is switched off.
Some apps may need it.
The ifconfig and route commands, substitute the dummy device at the address where the sl0 device was. I don't know if this is a good idea, or what exactly happens, but it can help. It would effect commands that use the nameservice, such as smail, and find the unreachability of the nameserver as a sign that the actual name (being looked up) is bad.
It also effects daemons that listen/attach to specific interface addresses. eg samba has to be configred for each of its eth0 and sl0 addresses.
Really those two lines should be put into /etc/rc.d/rc.dummy_tdc, where the other devices are.
The tdc_me parameter gets looked up in /etc/hosts, to be the IP_ADDR to use. If your /etc/hosts file is shared between multiple hosts, you may need to rethink it.
# dip_out # dip -k # for single dip session # killall dip # slightly more drastic option PATH=$PATH:/sbin ifconfig dummy tdc_me route add tdc_meThe ifconfig and route commands in rc.inet1 (rc.eth0), are much the same as those used for the dummy, and called internally by DIP.
/dev/eth0 exists (on SVR4 machines at least), but with route and ifconfig, eth0 eth1 sl0 ppp0 dummy0 are names not filenames or devices (but they are devices!)
sl0 is a TCP/IP device, like eth0, but customised to handle serial lines, where data comes in waves of bytes, not packets.
You may wish to set up sendmail first, and get a result first time.
As the root user run dip_in - it is on your path! You did do chomd 755 on it! I hope you used the dip-example files (not mine), and modified the values for your machine.
Note, these texts have been edited after importing to HTML. Sorry for any errors introduced!
Naturally, this worked first time! To confirm this use ping tdc_gw or the name you used as the other end of the SLIP connection.
Now test that DNS is working using ping sunsite.unc.edu, or src.doc.ic.ac.uk (Imperial College, Academic, UK ). Since you didn't type in those addressess, they must have come from (or via) your nameserver.
Note for UK users: Imperial College has a shocking cd sunsite prefix, but ftp runs a tad faster, it also has many categories in /pub/packages, including TCL/TK for MS-WIN.
Now try:
mkdir /tmp/ftp cd /tmp/ftp ftp sunsite.unc.edu (or src.doc.ic.ac.uk) ftp-login: anonymous password: abc@ (your login, be polite) cd /pub/Linux/system/Network/info-systems pwd ls # on src.doc.ic.ac.uk try something like # /packages/linux/sunsite.unc-mirror first, us ls hash # show 1 K progress mget mosaic* # takes ages, so make your choice mget netscape* # has problems when remote X11 display dip_out
If you have mc-3, you can also run
mc /tmp/ftp ftp://src.doc.ic.ac.uk/pub/packages
With Slackware, you already have Lynx on the disk, and with Infomagic/sunsite, you already have arena, ready to untar and link. Netscape and Mosaic are NOT on the disks! You have to have Internet access to get them.
Lynx runs on a text tty, arena needs X11 to run. Configuring X11 needs a bit of work to get just right.
If you find FTP is a bit slow, eg to a site connected by modem, or an overloaded host, you can setup sendmail, then ask a kind third party (probably near rtfm.mit.edu) to ftp it for you, and send it uuencoded as email.
uuencode makes a binary file into a text file, expanding it by 40%, but V34 modems will compress SOME of that down again. netscape is 1.6 Mbytes big! which takes 10-20 minutes to download. Getting it from a slow host will take longer, and your local ISP machine SHOULD be faster! To see if your SMTP line is active, use netstat.