DiP-NeTworking-mini-HowTo [STABLE 4-14-96]

DiP-NeTworking-mini-HowTo [STABLE 4-14-96]

Post by Kent Robot » Sat, 13 Apr 1996 04:00:00



DiP-NeTworking-mini-HowTo "Trust this, and get connected." (Kent Robotti)

(Unknown server error, Network is unreachable, = Network not configured
correctly.....................................................................)

(Contents...) (1)... Important Network Files...
              (2)... DiP...
              (3)... PppD...
              (4)... NFS...
              (5)... Software Recomendations...

(1)...Files to be concerned with, /etc/HOSTNAME, hosts, resolv.conf, rc.inet.)

(There,s a shell script, called netconfig.)
~/# netconfig      <-If you installed it..?)

If Not, Or Even If............................................................)

~/# vi /etc/HOSTNAME  ........................................................)

darkstar.ios.com         <-Just one line, the name you give
                           your network, your computer, (darkstar)
                           and your ISP, service providers name, (ios.com)>

darkstar~/# vi /etc/hosts  ...................................................)      

127.0.0.1       localhost
0.0.0.0         darkstar.ios.com darkstar    <-0.0.0.0 = I have a Dynamic IP
                                               address. Your sevice provider
                                               assigns you one, either static-
                                               ly, it's the same everytime, or
                                               dynamicly, it,s different every-
                                               time...)                                              

darkstar~/# vi /etc/resolv.conf  .............................................)                  

domain ios.com                   <-Your service providers domain name.)
nameserver 198.4.75.45           <-Your service providers IP address,
nameserver 198.4.75.46             if more than one, include them all...)
nameserver 198.4.75.44

darkstar~/# vi /etc/rc.d/rc.inet1   .........................................)

HOSTNAME='hostname'

#Attach the loopback device.
/sbin/ifconfig lo 127.0.0.1          <-Configure loopback, so you can ping      
/sbin/route add -net 127.0.0.1         yourself ~/# ping 127.0.0.1)
#
#
#
#                                    <-If you just have a slip/ppp connection,
#                                      You can comment # out the rest of this          
#                                      file #################################)

~/# vi /etc/rc.d/rc.inet2   ..................................................)

# Constants
NET="/usr/bin"
# IN_SERV="lpd"
# LPSPOOL="/var/spool/lpd"
#
#
echo -n "Starting daemons:"
#
#
# Start the SUN RPC Portmaper           <-If you want to use (NFS) to mount
if [ -f{NET}/rpc.portmap ]; then          remote filesystems, include these
   echo -n " portmap"                     lines, The rest of this file can
   ${NET}/rpc.portmap                     be commented out #################
fi                                        Unless your acting as a server..?)
echo
#
#
#
#

~/# vi etc/rc.d/rc.M   .......................................................)

# Tell the viewers what's going to happen...
echo "going multiuser..."
# Screen blanks after 15 minutes idle time.
/bin/setterm -blank 15                              <- 0 = No Blanking...)
# Look for CD-ROM...........................            
# Remove # this, Put this line in /etc/fstab
# /dev/cdrom  /cdrom  iso9660  noauto,ro  0 0
#  Now -> ~/# mount /cdrom  ~/# umount /cdrom
# Set the hostname..............................
/bin/hostname `cat /etc/HOSTNAME | cut -f1 -d .`      (If you just have a slip/
#Initialize the NET subsystem.                         ppp connection, anything
if [ -x /etc/rc.d/rc.inet1 ]; then                     not listed here, can be  
. /etc/rc.d/rc.inet1                                   commented out ##########  
. /etc/rc.d/rc.inet2                                   #######################)
#
#
fi
# Remove stale locks.........
Yes! leave this in...(No ###)
# Remove stale hunt sockets..
Yes! leave this in...(No ###)
#Update all the sharred library links automatically.
/sbin/ldconfig
#
#
#
# Start the local setup procedure.
. /etc/rc.d/rc.local
# All done.

(2)...(Manual login, useing  DiP..............................................)

darkstar~/# dip -t
DIP> port /dev/cua1       <-cua1=com2, cua0=com1 or /dev/modem)
DIP> speed 38400
DIP> term
ATZ            <-Enter>
AT&F%C0W2    
ATDT2956700    <-The phone number.)

Login: Password: Your IP address is 1?.2?.3?.4? - My IP address is 198.4.75.45

(To exit, dip term mode, press the keys, [Ctrl] ]

DIP> get $locip 1?.2?.3?.4?      <-Your IP address...)
DIP> get $rmtip 198.4.75.45      <-Your service providers IP address...)  
DIP> default
DIP> mode ppp      <Or slip, cslip>

darkstar~/# ping 198.4.75.45     <-To see if your connected...)
(Press the keys...) Ctrl z or Ctrl c to exit ping, or anything...)
If connected, then... darkstar~/# lynx, ftp, telnet, etc...
darkstar~/# dip -k   <-To kill dip...)          
                                               /var/spool/uucp/LCK..cua1
Every time dip, is run, it creates lock files, /usr/spool/uucp/LCK..cua1,
/etc/dip.pid, if you kill dip properly, or reboot, these should be
removed, otherwise you can't use dip, until you remove them.

(Sample DiP Script............................................................)
~/# vi ppp.dip

main:
port /dev/cua1            
speed 38400                      
reset                                   <-Reset = ATZ)      
send AT&F%C0W2MO\r                      <-M0=no sound ?)
wait OK 2                               <-Wait for OK response, from the modem.)
if $errlvl != 0 goto OK                 <-If not found, say so.)
send ATDT 295-6700\r                    <-Phone number.)
wait BUSY 10                            <-Wait 10 sec, if line is busy, say so.)
if $errlvl != 3 goto LINE_BUSY          <-No comment...)
wait CONNECT 35                         <-35 sec. to connect.)
if $errlvl != 0 goto CAN'T_CONNECT
login:
wait annex: 5                  <-Some logins, require the annex: step, as well
if $errlvl != 0 goto annex:      as others, if not, skip to, wait login: 15.)
send 3\r                       <-annex: number, and <Enter>
wait login: 15                 <-Wait for login: prompt, for 15 seconds.)
if $errlvl != 0 goto login:    <-If login: prompt, is not found in 15, say so.)
send jerry\r                   <-Login name, (jerry) and \r = <Enter>)
wait Password: 10              <-P or p ?, assword: if not sure.)
if $errlvl != 0 goto Password:
send secret\r                        <-Password and <Enter>)
sleep 5                              <-Pause 5 seconds ?)
get $remote remote 3                 <-Get your service providers IP address.)
if $errlvl != 0 REMOTE_IP_?
get $local remote 3                       <-Get my IP address, from my service
if $errlvl != 0 goto LOCAL_IP_?             provider...)
get $mtu 1500                             <-Set maximum, transmit and receive
get $mru 1500                               units, standard stuff...)
default
print PPP CONNECTED $locip -> $rmtip   <-Print to screen Local IP:Remote IP.)
mode ppp                               <-Or slip, cslip...)
exit
done:

~/# chmod u+x ppp.dip    <-Make ppp.dip executable...)
~/# dip ppp.dip          <-Execute ppp.dip...)
(Look for this and that... not found) This will pinpoint the problem,
not enought time, misspellings, etc...)
~/# dip -v ppp.dip       <-To run the script in verbose mode...)

(Putting it all together...)
~/# vi ppp      

rm /usr/spool/uucp/LCK..cua1     <-cua1=com2 cua0=com1 ?)
rm /var/spool/uucp/LCK..cua1
rm /etc/dip.pid
dip ppp.dip                  

~/# chmod u+x ppp
~/# ppp    <-Removes lock files, and starts dip, to execute script...)

(3)...(Compileing ppp-2.2.0e...) ~/ppp-2.2.0e# configure       ................)
                                             # make kernel
                                             # make
                                             # make install

(If ppp does,nt install the scripts...) ~/ppp-2.2.0e# mv scripts /etc/ppp

(If your getting errors, trying to compile ppp-2.2.0e, take a look at..........)
~/#ppp-2.2.0e/pppd/pppd.h   <-About 30 lines, from the top...)

#include <sys/types.h>      <-Change this line...)
#include <sys/bitypes.h>    <-To this...)

?/# find / -name if_arp.h
(If your still getting errors, take a look at /usr/include/linux/if_arp.h)
(About 8 lines, from the end...)

    unsigned char   ha[MAX_ADDR_LEN];   <-Change this line...)  
    unsigned char   ha[4];              <-To this...)

(More errors, take a look at ~/ppp-2.2.0e/pppd/sys-linux.c...)
(About 40 lines from the top...)

#include <net/?>               <-Change these to <linux/?>
#include <net/?>               <-There are five or six to change...)
#include <netinnet/in.h>       <-This one,s allright..........................)

(After you,ve made a connection to your service provider, and started slip/ppp
on that end, you can [Quit,Suspend] the program you used to make the connection.
(Your IP address is 0.0.0.0 - My IP address is 198.4.75.45)
(Minicom...?...Press the keys [Ctrl] j (To suspend minicom.....................)

(Now start pppd...~/# pppd /dev/cua1 &
                    # ifconfig lo 0.0.0.0      <-Your IP address(Must match
                                                 /etc/host, 0.0.0.0 = Dynamic)
                                                 Otherwise if (known) = (static)
                                                 Put address as given by your
                                                 service provider..............)  
                    # route add -net 198.4.75.45   <-Your service providers IP
                                                     address...................)
                    # ping 198.4.75.45
                    # fg minicom    <-To get back to minicom...................)
                    # ppp-off       <-If it,s in your path....................?)
                    # cat 'ath0' >/dev/cua1  <-Hang Up The Modem...............)      

(PPP scripts, to be concered with, (ppp-on) defines some parameters, and
calls the program /usr/sbin/chat, to execute the chat script (ppp-on-dialer)
(ppp-off) exits ppp...........................................................)

(There,s a little shell script, you might want to get, called (pppsetup)
this will ask you questions, and output the answers, to a couple of files,
(ppp-go) -> & -> (pppscript) this chat script will connect you, based on the
answers you gave (pppsetup) and start ppp.....................................)
(ftp.cc.gatech.edu)
(pub/Linux/Network/serial)(pppsetup)
(Remove those ^M (Cariage Returns)...(~/# fromdos <pppsetup> PPPSETUP
(Make PPPSETUP Executable............(~/# chmod u+x PPPSETUP
Allso PPPSETUP will look for pppd & chat in /usr/lib/ppp/pppd & chat
These will more likely be in /usr/sbin/pppd & chat (So change this in PPPSETUP,
about 17 lines from the end...(echo "/usr/lib/ppp/pppd & chat   <-Change...)

(Your /etc/ppp/options file, should look something like this, if not exactly...)

lock
/dev/cua1
38400
modem
defaultroute
crtscts
mru 1500
mtu 1500
passive
bsdcomp 15,15   <-Add this line for bsd compression, if the module (bsd_comp.o)  
                  is installed, and it can be loaded, Otherwise Not...........)

(4)...NFS...(NETWORK...FILE...SYSTEM..........................................)

(To mount a remote filesystem, over a ethernet or slip/ppp conection..........)

(You have to have (NFS) FILESYSTEM SUPPORT enabled in your kernel.............)
~/# cat /proc/filesystems    <-To see a listing of supported filesystems......)
      ext2
      msdos
nodev proc
nodev nfs       <-Ureika!!!)
      iso9660

(Put the name's of the remote hosts, you want to mount, in /etc/fstab.........)

~/# vi /etc/fstab

/dev/hda1      /        ext2         defaults   1 1
none         /proc        proc      defaults   1 1
/dev/cdrom      /cdrom      iso9660    noauto,ro  0 0
wuarchive.wustl.edu:/archive/.archive01   /mnt  nfs   ro,soft  0 0
nfs.diaspar.com:/slackware   /mnt   nfs   ro,soft  0 0

(After your connected, ethernet or slip/ppp, mount the remote host............)
~/# mount nfs.diaspar.com:/slackware /mnt
~/# cd /mnt
~/# ls

(5)...Software Recomendations.................................................)

(1). [ncftp...] (Has -C -R Options, so you can resume a download, that was
                interrupted, and retrieve entire directories...)
                (ftp.cc.gatech.edu)
                (/pub/Linux/system/Network/file-transfer
                (ncftp-2.3.0?.tgz)

(2). [slrn...] (Fast Newsreader, Perfect for a slip/ppp connection...)
               (ftp.space.mit.edu (/pub/davis/slrn)
     [slang...] (Required by slrn, to compile...)
                (/pub/davis/slang)

(3). [lynx...] (Fast Non-Graphical, WWW Browser...Compile with slang...color...
                more stable...make linux-slang...Or...make linux-ncurses..?)
               (http://www.wfbr.edu/dir/lynx)
               (lynx2-4-fm.zip)

(4-14-1996-STABLE)