SUMMARY: Chat script for null-modem PPP?

From: Homan, Charles (NE) (Charles.Homan@GDC4S.Com)
Date: Wed Mar 12 2003 - 16:32:14 EST


First, my thanks to the respondees: Darren Dunham, Lars Hecking, Alan Pae,
and Bill Voight. I was pointed to both http://www.stokely.com/ (which I was
already using :-) and
http://yakko.cs.wmich.edu/~lcucos/prjs/ppp/wmu-directPPP.html.

This was far easier than I was attempting to make it. (Ah, the bad old days
of aspppd!) However, a couple points are worth mentioning. (And - in a
mini-rant - what is the point of a SUMMARY if no one can follow it without
knowing your system intimately? Mini-rant #2: PLEASE summarize your
questions and their answers!!! I feel better now. ;-)

In "Celeste's Tutorial on Solaris 2.x Modems and Terminals"
(http://www.stokely.com/unix.serial.port.resources/modem.html), I noticed a
phrase I missed on the first reading: "NEVER use software flow control with
UUCP/PPP or the protocol will go nuts from the unexpected XON and XOFF
characters". (It appears that there is an option in PPP 4.0 which accepts
software flow control, but I didn't wind up using it.) Second, the
null-modem cable I was originally given was wired wrong. The guy who wired
it swore it would work, but he was testing it on a PC. His pinouts were:

1-----1
2-----3
3-----2
4-----6
5-----5
6-----4
7-----8
8-----7

The proper wiring, as I eventually convinced him, is:

1--+
   |--4
6--+
2-----3
3-----2
   +--1
4--|
   +--6
5-----5
7-----8
8-----7

See http://www.geocities.com/SiliconValley/Heights/5704/serial1.html. Once
the cable was wired properly I could tip with hardware flow control turned
on.

Since my configuration is on a private network I could use "noauth", which
effectively does away with the chat script. I removed the port monitor on
ttya since it wasn't needed:
# pmadm -r -p zsmon -s ttya
(I'm not positive this is necessary, though.)

Also, since these machines will only ever connect to each other I could just
use the /etc/ppp/options file for all of my connection info. To wit, on
machine1:

# cat /etc/ppp/options
cua/a
19200
crtscts
lock
passive
machine1-serial:machine2-serial (reversed on machine2)
logfile /var/adm/ppplog
noauth
persist
debug (just for debugging... ;-)

I used the file /etc/ppp/ifconfig to start pppd in preference to changing
the default init script (/etc/init.d/pppd):
# cat /etc/ppp/ifconfig
pppd

For use in the options file (and for my convenience later) I defined names
for the serial ports in /etc/hosts:
# cat /etc/hosts
aaa.bb.cc.ddd machine1 (replaced with machine2's IP/name on
machine2)
aaa.bb.ee.fff machine1-serial
aaa.bb.ee.ggg machine2-serial

I used the file /etc/ppp/ip-up to initiate my routes:
# cat /etc/ppp/ip-up
#!/bin/sh
/usr/sbin/ndd -set /dev/ip ip_forwarding 1
/usr/sbin/route add aa.bb.ee.hhh/27 aaa.bb.ee.ggg (/27 masked network,
route through machine2-serial; different route and gateway on machine2, but
the same principle)

(Note that I did *not* want defaultroute on my ppp line, as each machine is
connected to networks that the other shouldn't necessarily know about.)

With all of that in place, I can boot the machines in either order. The
first machine to come up attempts to initiate a connection. If (when) it
fails, it simply waits passively for the other machine. When the second
machine comes up, it attempts to initiate a connection which is accepted by
the first machine, they both turn on IP forwarding and set up their routing
tables, and everything works.

Regards,
Charles

> -----Original Message-----
> From: Homan, Charles (NE)
> Sent: Monday, March 10, 2003 2:55 PM
> To: 'sunmanagers@sunmanagers.org'
> Subject: PARTIAL SUMMARY: Chat script for null-modem PPP?
>
>
> OK, I think the chat piece is good to go now, but I don't have a good
> connection yet. Thanks to Lars Hecking and Darren Dunham for their
> responses. Lars suggested the following:
>
> > Only ever used ppp for dialing in over a phone line, but
> you probably get
> > by with
>
> > TIMEOUT (some number)
> > CONNECT ''
> > 'ogin:' (user id)
> > 'word:' (passwd)
> > 'prompt' ppp
> >
> > where prompt is replaced with the actual prompt you get.
> Above is what is
> > left over after taking out abort and modem commands from
> my laptop dialin
> > chat script.
>
> I have done this, and it seems to work as far as logging in
> goes. However,
> I get gobbledegook (stuff that looks like line noise) when
> the connection is
> made, and it then times out. (I connect by running pppd at
> the prompt.)
>
> Also, when I use tip to connect from the "client" machine, I
> can log in as a
> normal user and it acts like tip should. When I log in as
> ppp_user, though,
> I get the same gobbledegook as when I run pppd, and then get
> dropped back to
> a login: prompt.
>
> I used admintool to configure the serial ports. I'm using a
> 19200 baud
> connection with software flow control, with "Service enable"
> turned on on
> the server and off on the client. I didn't change much else.
>
> Any ideas what could be wrong?
>
> Thanks,
> Charles
>
>
> > -----Original Message-----
> > From: Homan, Charles (NE)
> > Sent: Thursday, March 06, 2003 5:01 PM
> > To: 'sunmanagers@sunmanagers.org'
> > Subject: Chat script for null-modem PPP?
> >
> >
> > All:
> >
> > I am currently struggling with getting two machines (Sunblade
> > 100s running
> > Solaris 8) to talk to each other via pppd over a null-modem serial
> > connection. I am unclear what my chat script should look
> > like. Do I just
> > want them to look for "ogin:" and "word:" and issue the
> > proper responses, or
> > is there more to it? (Actually, if there isn't more to it,
> > I'm not sure
> > what I'm doing wrong.) Any help would be most appreciated!
> >
> > Thanks,
> > Charles
> > _______________________________________________
> > sunmanagers mailing list
> > sunmanagers@sunmanagers.org
> > http://www.sunmanagers.org/mailman/listinfo/sunmanagers
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:58 EDT