Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Aug 95 17:24:18 +0000
From:      vernon@public.bta.net.cn
To:        questions@FreeBSD.ORG
Subject:   ping local system
Message-ID:  <9508210025.AA0034@vernon.priv.bta.net.cn>

next in thread | raw e-mail | index | archive | help
I have been trying to set up basic networking services on my FreeBSD system and connect
with a local Internet Service Provider (ISP) through ppp.  I am able to connect and establish a
ppp connection with the ISP.  

My question pertains to pinging my local system prior to the ppp connection.  My understanding 
is that prior to making any type of network connection (through serial port, parallel port or NIC) 
that I should be able to ping my local system through the "localhost" or the local system name 
"vernon".  This should all take place through the loopback driver lo0.  My current configuration 
allows me to ping via "localhost", however when I ping "vernon" there is no response.  After I 
establish a ppp connection I can ping "localhost", "vernon" and "public" without any problem.  
I have attached copies of the files (or command output) related to my system.

=======
/etc files
=======

-------------------------------- ( hosts ) ------------------------------------

127.0.0.1       localhost       localhost
202.96.2.107    vernon          ppp.vernon.priv.public.bta.net.cn
202.96.0.133    public          public.bta.net.cn

------------------------------- ( myname ) ----------------------------------

vernon

---------------------------------- ( rc ) -------------------------------------

(partial listing only)

# set hostname, turn on network
echo 'starting network'
. /etc/netstart

------------------------------- ( netstart ) ----------------------------------

#!/bin/sh -
#
#	$Id: netstart,v 1.17 1994/11/07 04:02:25 phk Exp $
#	From: @(#)netstart	5.9 (Berkeley) 3/30/91

defaultrouter=NO
routedflags=-q
timedflags=NO
xntpdflags="NO"
ntpdate="NO"
rwhod=NO
sendmail_flags="-bd -q30m"
amdflags="NO"
nfs_client=NO
nfs_server=NO
name_server=NO
savecore=NO
#kerberos_server=YES
#gated=YES

# my-name is my symbolic name
# my-netmask is specified in /etc/networks
#
if [ -z "`hostname -s`" ] ; then
	hostname=`cat /etc/myname`
	/bin/hostname $hostname
fi

for i in /etc/hostname.*
do
	ifn=`expr $i : '/etc/hostname\.\(.*\)'`
	if [ -e /etc/hostname.$ifn ]; then
		if [ -e /etc/start_if.$ifn ]; then
			sh /etc/start_if.$ifn $ifn
		fi
		ifconfig $ifn `cat /etc/hostname.$ifn`
		ifconfig $ifn
	fi
done

# set the address for the loopback interface
ifconfig lo0 inet localhost

# set interface for multicasts to default interface
# this needs to happen before router discovery
#route add 224.0.0.0 -netmask 0xf0000000 -interface $hostname

if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
	route add default $defaultrouter
elif [ -f /etc/defaultrouter ] ; then
	route add default `cat /etc/defaultrouter`
fi

# use loopback, not the wire
route add $hostname localhost

----------------------------- ( netstat -r ) ----------------------------------
execution before running pppstart 
"vernon" should use localhost and the loopback driver lo0 but does not respond to
ping.
-----------------------------------------------------------------------------

Routing tables

Internet:
Destination      Gateway            Flags     Refs     Use  Interface
localhost        localhost          UH          1       33  lo0
vernon           localhost          UGHS        0        0  lo0

----------------------------- ( pppstart ) ------------------------------------


#!/bin/sh 

pid=`ps -ax | grep pppd | grep -v grep | awk '{print $1;}'`
if [ "${pid}" != "" ]
then
    echo 'killing pppd, PID=' ${pid}
    kill ${pid}
fi

pid=`ps -ax | grep kermit | grep -v grep | awk '{print $1;}'`
if [ "${pid}" != "" ]
then
    echo 'killing kermit, PID=' ${pid}
    kill -9 ${pid}
fi

ifconfig ppp0 down
ifconfig ppp0 delete

kermit -y /etc/ppp/kermit.dial

----------------------------- ( start ppp ) -----------------------------------

pppd /dev/tty00 9600 &


----------------------------- ( netstat -r ) ----------------------------------
execution after pppstart starts ppp
can now ping "localhost", "vernon" and "public" and all respond properly
----------------------------------------------------------------------------

routing tables

Internet:
Destination      Gateway            Flags     Refs     Use  Interface
default          public             UG          0        0  ppp0
localhost        localhost          UH          1       32  lo0
public           vernon             UH          1        0  ppp0
vernon           localhost          UGHS        0        0  lo0

=====================================================================

Any help with this problem would be appreciated.  

My plan is to do some playing with TCP/IP programming in client/server mode, which 
requires I can connect locally with other concurrent processes.

=====================================================================

One additional item (hope this is the right forum).  The PPP documentation includes 
several shell script/kermit script files that assist in setting up a ppp connection with
another machine.  I found two problems when I tryed to implement these scripts on
my system.

1)  The kermit.dial script is called from a shell script, however it is set up to call the
     exit command to exit kermit.  This causes the modem on my PC to hang up.  I think
     the intent is to suspend kermit and that this command should be changed to the "Z"
     command that suspends kermit.

2)  When kermit suspends or exits, shell script execuition discontinues.  A new shell is
     spawned? when suspend takes place, so the final command in the pppdial shell script
     (pppd [device] [speed] &) needs to be executed at the command line outside of the
     shell script.

Thank you in advance for your assistance.

vernon@public.bta.net.cn




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9508210025.AA0034>