I just need to send/receive a messages through a unix-socket with PPP. But at first I want to launch the pppd with an usual serial port to make sure I know how it works. As I see, if I bind a pppd to a serial, all the packets that has come there will be unwrapped from PPP/IP/..., and redirected to some port with my application. As I understand this could be only done by creating a new network interface by the pppd. So I am need to give an IP to pppd. After reading a manuals, and getting some problems I figure out an options that seems to be right, but I still can't get it working:
$ pppd local -detach 10.5.57.198: /dev/ttyS4
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS4
LCP: timeout sending Config-Requests
Connection terminated.
Modem hangup
Before the title LCP: timeout sending Config-Requests
appears I have some time, and I launched in this time ifconfig
-- alas, here is no new network interface appeared.
Also I was seeked for a tutorials, but all that I found is doesn't seem to be useful, mostly because these deprecated: these often mention a configs, or soft, or sites that is not present right now. And partially because these mention many actions which doesn't seem to carry a sense for me.
So, do anybody knows, what is the options I am missing?
PPP in general, and
pppd
specifically, were mostly used for dialup connections, so all of the defaults assume that thepppd
process will be started as part of a manually-initiated sequence. The preceding step in the sequence is supposed to be establishing a serial connection (i.e. the modem indicates completion of its handshake with the remote modem by sayingCONNECT
)You want to reverse the order of things, starting
pppd
first and making it wait for the physical connection to appear. Thepersist
option does that.The documentation for
persist
saysso you might also need
maxfail 0
to override that. Other related options I can see from a quick look at the man page aredemand
,idle
, andholdoff
, all of which will help you control how the in, terface behaves when the peer is not present.And another useful one: the
connect
option, which is used in the dialup case to specify a program that dials the modem, might be useful to you. You could specify aconnect
script that just watches the serial port status and exits when a connection is present.