Bug 881

Summary: Why the plip interface does not work & a simple laplink script
Product: [Retired] Red Hat Linux Reporter: ppe
Component: netcfgAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-03-23 02:22:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ppe 1999-01-19 19:42:40 UTC
Hi,

when I use netcfg to setup a laplink connection for device
plip1
the file "/etc/sysconfig/network-scripts/ifcfg-plip1"
is generated with two bugs:
1) `DEVICE=plip1' line missing.
2) `NETWORK=' line is empty, unless the user presses enter
in the
   NETMASK field. This entry should always be generated
(many people just klick on DONE after setting netmask).

Example, netcfg generated the following ifcfg-plip1 file for
me:

BOOTPROTO=none
USERCTL=yes
ONBOOT=no
NETWORK=
NETMASK=255.255.255.0
REMIP=128.163.161.100
IPADDR=128.163.161.166

When the plip1 interface is than started, I get many script
errors.
After I changed the file manually to

DEVICE=plip1
BOOTPROTO=none
USERCTL=yes
ONBOOT=no
NETWORK=128.163.161.0
NETMASK=255.255.255.0
REMIP=128.163.161.100
IPADDR=128.163.161.166

... the connection script works. BTW, Linuxconf seems to
have similar problems.

I append my simple `laplink' script which you may
distribute.
It allows to quickly manage direct serial and parallel
connections.

Cheers,
Peter.

-----------------------------------------/sbin/laplink:
#!/bin/sh
# Copyright GPL, P. Englmaier <ppe_at_pa.uky.edu>, 1998

PATH=/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin

host=`hostname`
SPEED=spd_normal
while : ; do
  if [ $# = 0 ]; then
    cat - <<EOF
Laplink - connect to a remote computer using a serial null
modem
          or parallel laplink cable.

Start a serial port connection with
   laplink [-no] [-hi] [-vhi] <port> <remote>

    -no      for normal speed (38400 baud) (default)
    -hi      for high speed (57600 baud)
    -vhi     for very high speed (115000 baud)
    <port>   serial device port; can be: ttyS0 ttyS1 ttyS2
ttyS3
    <remote> remote ip or name (should be defined in
/etc/hosts)

Start a parallel port ppp connection
    laplink  <device> <remote>

    <device> parallel device; can be: plip0, plip1, plip2.
These
             correspond to parallel ports lp0, lp1, lp2.
    <remote> remote ip or name (should be defined in
/etc/hosts)

Stop a running connection
    laplink stop <port>
or
    laplink stop <device>
EOF
  exit 0
  fi

  case $1 in
    -no*)
	SPEED=spd_normal
	shift ;;
    -hi*)
	SPEED=spd_hi
	shift ;;
    -vhi*)
       	SPEED=spd_vhi
	shift ;;
    ttyS*)
	setserial /dev/$1 $SPEED
	pppd /dev/$1 38400 nocrtscts defaultroute $host:$2 local
persist passive     &
	break;
	;;
    plip[0-9])
	ifconfig $1 $host pointopoint $2
	route add $2 $1
	break;
	;;
    stop)
	case $2 in
	plip[0-9])
	   ifconfig $2 down
	   exit 0;
	   ;;
	ttyS*)
	   line=`ps ax | grep 'pp[p]d /dev/'$2`
	   if [ "$line" = "" ]; then
	     echo laplink: stop: Cannot find pppd process for $2
	     exit 1
	   else
	     kill -9 `echo $line |awk '{print $1}'`
	     exit 0
	   fi
	   ;;
	*)
	   echo "laplink: bad port or device name">&2
	   exit 1
	   ;;
	esac
	exit 0
	;;
    *)
	echo "laplink: bad parameter(s). Run $0 without arguments
for help." >&2
	exit 1
	;;
    esac

done

exit 0

Comment 1 David Lawrence 1999-01-19 19:59:59 UTC
I have verified this to be true with 5.2. When creating a plip device
using netcfg, it does not properly put the DEVICE= line in the
/etc/sysconfig/network-scipts/ifcfg-plip<0-2> file. Also you have to
hit enter after entering the netmask before the network number is
created. This should be either documented in the dialog or the app
should be coded to check after hitting save to see if anything was
entered into the netmask box instead if just putting a blank NETWORK=
into the ifcfg file. Also something different needs to be done in
regards to setting up of plip devices because you really do not know
whether to use plip0, plip1, or plip2 until the module has been
properly inserted and the kernel reports which device it has created.

Linuxconf is supposed to address alot of these problems which will
make netcfg obsolete.

Comment 2 Preston Brown 1999-03-22 20:18:59 UTC
Michael, have you taken any action on this?

Comment 3 Michael K. Johnson 1999-03-23 02:22:59 UTC
fixed in netcfg-2.20
Will be available in RawHide and 6.0, but not as an erratum for 5.2