Dial-in linux server- PPP & serial getty?

Dial-in linux server- PPP & serial getty?

Post by Daniel Cav » Tue, 09 Dec 1997 04:00:00



Hi all.

I have a linux box that I use to connect to my ISP (Demon Internet) which is a static
IP. Everything is configured and works fine.

What I'd like to do, is configure my machine so that my other PC (which will reside at
my fathers house after xmas) can dial in to my machine and make a connection so that
email can be collected/sent via SMTP between remote machine.

vis.

       (localmachine)    <--->     (remote machine)
                   modem link/PPP/SLIP?

I appreciate that DNS and sendmail will need to be configured for a pseudo
network/mail client/server which I have an idea of what to do and how to get it
working and I've done practically the same on a lan.

I'd like to know if anyone has done anything similar to this (like an ISP would do I
suppose) What im really after is information on how I setup the modem to answer,
initiate the PPP connection, on the server side of things.  The other machine will be
another Linux machine.

Any hints and tips?

Regards,

Daniel Cave

Unix Systems Administrator
Arco Oil and Gas Exploration
Guildford, Surrey, UK

Direct Line             +44 01483 292285
UK Vodaphone mobile:    +44 0467 470139

Being a Unix admin ^[is] as easy as it looks! ^

 
 
 

Dial-in linux server- PPP & serial getty?

Post by Karl-Heinz Herrman » Sun, 14 Dec 1997 04:00:00


Hello Daniel!

I set up my Linux-Box just like what you want.
In essence you need to do:

1) Make shure you have pppd
2) I am using sendfax/mgetty, this works and I recomend to get it
    mgetty listens on the modemline, lets you dial out and starts listening again
    after you hang up, recognises fax and Dial-in attempts (even a voice answering
    version is available under the name vgetty)
3) mgetty has to be started in inittab
    add a line like:
S0:23:respawn:/usr/sbin/mgetty -s 115200 ttyS0
    for a modem on ttyS0 (the first to characters have to be  the same like the  last
    in your ttyXX name)
    :23: stand for "run this in runlevel 2 and 3"
    I drive my modem quite fast, if you have an older one or older serial chips use
    38400 or 57600 after the "-s"
4) There are somewhere config files for sendfax and mgetty (which are on my system in
     /usr/etc/mgetty+sendfax ). Have a look at them, but I think they are only for fax
5) When a  dial-in occurs, mgetty starts a login procedure which has to be handled by
     some dialin script (Since you wan't to use Linux, pppd and chat along with a ppp.chat)
     After the login a pppd has to be started.
     Two Options:
        normal login (maybe yours) and a shell is started
        then you (your script) has to start pppd (without chat this time, you
        don't have to dial...)

        Or: special account like user ppp and some passwd, but the login-shell is
        not /bin/bash but a script which starts imediatly the ppp-daemon

I use as dialin script: /usr/local/bin/ppp-dialin (executable)
------------------------------------------
#!/bin/bash
# Login script: started when user ppp is logging in
mesg n
stty -echo
exec /usr/sbin/pppd ttyS0 115200 -detach modem crtscts debug \
10.10.179.236:10.10.179.237 ipparam "dialin"
stty sane
---------------------------------------------
I don't know if the stty commands are really necessary, but they won't harm.
The pppd parameters: modem-device,  serial line speed (NOT modem transmition),
don't go in  background, use modem handshaking lines, use hardware handshaking,
give some debug information, My IP:your IP (You IP is the one the computer which is
dialing in will get), and last: ipparam will give a flag to ip-up (a script which is run
every time when a ppp-link is established --- And I wan't it to behave differently
when dialing in and dialing out (like: If I dial out send mails, if somebody dials don't
send mails...)

This should let you dial in and probably will work with some other
xxxtty program too.  mgetty has another config file:
/usr/etc/mgetty+sendfax/login.config This is way to let mgetty handle
the ppp-requests directly. Read the file-comments for further details
(I don't use this (yet)).

I hope it will work, and please ask if you have problems with setting up any of
the scripts.

Karl-Heinz
-------------------------------------------------------------

Quote:

> Hi all.

> I have a linux box that I use to connect to my ISP (Demon Internet) which is a static
> IP. Everything is configured and works fine.

> What I'd like to do, is configure my machine so that my other PC (which will reside at
> my fathers house after xmas) can dial in to my machine and make a connection so that
> email can be collected/sent via SMTP between remote machine.

> vis.

>        (localmachine)    <--->     (remote machine)
>                    modem link/PPP/SLIP?

> I appreciate that DNS and sendmail will need to be configured for a pseudo
> network/mail client/server which I have an idea of what to do and how to get it
> working and I've done practically the same on a lan.

> I'd like to know if anyone has done anything similar to this (like an ISP would do I
> suppose) What im really after is information on how I setup the modem to answer,
> initiate the PPP connection, on the server side of things.  The other machine will be
> another Linux machine.

--
--------------------------------------------------------
Karl-Heinz Herrmann, Stubenlohstr. 25, D-91052 Erlangen


 
 
 

1. GETTY Dial Ins

I am looking for some assistance with linux dial-in lines (like everyone
else it seems). I am using getty_ps (didn't like MGetty, but thats another
story). First the problem I am encountering, and then my config files:

1) I have two dial ins. A Supra288 on ttyS0, and an ATI 19.2ETCi on ttyS2. I
   have put into each modem's reset profile: ate1q0v1s0=0&c1&s0&d3&k3.
2) When first initialized, they answer fine. But when someone disconnects (be
   it via logout or hanging up), the modems won't answer until I 'init q'
   again. Additionally, I noticed the Supra (an external, so I assume the ATI
   is doing it as well but I can't see it) is reseting itself every minute or
   so.

Any clues on how to correct these problems? Or is it possible to hgave a script
executed after a user logs off to essentially 'init q'?

Here are my configurations:

INITTAB:

(cut)
d0:456:respawn:/sbin/uugetty -t 90 ttyS0 38400 vt100
#d1:456:respawn:/sbin/uugetty -t 90 ttyS1 19200 vt100
d2:456:respawn:/sbin/uugetty -t 90 ttyS1 19200 vt100
(cut)

GETTYDEFS:

(cut)
38400# B38400 CS8 # B38400 CRTSCTS SANE -ISTRIP HUPCL #Account Name: #38400
19200# B19200 CS8 # B19200 CRTSCTS SANE -ISTRIP HUPCL #Account Name: #B19200
(cut)

/etc/default/uugetty.ttyS0

ALTLOCK=cua0
ALTLINE=cua0
INITLINE=cua0
CLEAR=YES
HANGUP=YES
LOGIN=/bin/login
ISSUE=/etc/serialissue
VERSION=/proc/version
SYSTEM=Orbital
TIMEOUT=60
INIT="" \d+++\dATH-\r OK \r\n ATZ0\r\n
WAITFOR=RING
CONNECT="" ATA\r CONNECT\s\A

/etc/default/uugetty.ttyS2
ALTLOCK=cua2
ALTLINE=cua2
INITLINE=cua2
CLEAR=YES
HANGUP=YES
LOGIN=/bin/login
ISSUE=/etc/serialissue
VERSION=/proc/version
SYSTEM=Orbital
TIMEOUT=60
#INIT="" \d+++\dATH0\r OK \r\n ATZ\r\n # <- Won't workon the ATI???
INIT="" ATZ\r OK\r\n
WAITFOR=RING
CONNECT="" ATA\r CONNECT\s\A

Help would be appreciated!
--

"http://orbital.ccinet.ab.ca/staff/sbanick.html"/"http://orbital.ccinet.ab.ca"
   "A single note, chord, or noise - whether violent, passionate, regular,
    uniform or beautifully calm, conveys what we are feeling." - B. Hannant

2. Linux hardware support...

3. Need Help on setting up getty for dial-ins

4. Agenda for Mar 7 Call - note new number

5. PPP problems with multiport dial-in/dial-out server

6. --Job Opening << Unix Sys. Admin. on the WWW >> Recruiter sfsys

7. PPP dial-in client Cannot see past PPP Server

8. Matrox Malenium support in Linux?

9. Setup Linux as a Dial-In PPP server !

10. Linux machine as a PPP dial-in server??

11. Dial-in PPP connection to Shiva Lanrover server from Linux

12. HELP: Setting up a DIAL-IN PPP SERVER on my Linux box??

13. Linux PPP dial-in Server -info needed!