Re: Re: Pregunta Ras
Por si te sirve:
Debian PPP dialin and callback server
Introduction
First of all sorry for my english. I decided to write this tutorial to help
people to configre their linux machine to run PPP dialin and callback
services. First time I was working on this for about 12 hours even using
other tutorials, but they had small misconfigurations, so using all the
material I found on the web finally I got what I want.
Software (pre configuration)
I was using debian OS:
debian:~# uname -a
Linux debian 2.2.20 #1 Sat Apr 20 11:45:28 EST 2002 i586 unknown
NOTICE: You need to be superuser for now!
When I started configuring and reading manuals, I tested if there is ppp
package installed on my computer:
debian:~# whereis pppd
pppd:
It means, where is no pppd package installed on my computer. So I installed
it:
debian:~# apt-get install ppp
When I continued reading manuals and found that I need mgetty package too.
Again I tested if there is package mgetty on my computer:
debian:~# whereis mgetty
mgetty:
Again there was no this package so I installed it:
debian:~# apt-get install mgetty
Now all packages are installed on my computer for PPP dialin and callback
services.
Hardware (modem)
I have external modem connected to my computer on COM1 it means /dev/ttyS0.
You can have COM2 so it's on /dev/ttyS1. You have to be sure that your modem
is supported by LINUX OS, because my tutorial doesn't cover this topic. No
futher configuration is needed for modem and we are ready for configuring our
system.
Configuration (dialin)
Here are steps that I did configuring my system.
1. Create new group ppp, for this you need to edit file /etc/group and add
this line on the end of file:
ppp:x:1001:
2. Create new system user for dialin connection pppuser: Simple create new
system user and when using shell command vipw change line of user pppuser to
this:
pppuser:x:1001:1001:,,,:/home/pppuser:/usr/sbin/ppplogin
3. Create new file /usr/sbin/ppplogin:
#!/bin/sh
#/etc/ppp/ppplogin
# PPP login script
mesg n
stty -echo
exec /usr/sbin/pppd -detach modem debug crtscts
4. Set access attributes for this file:
debian:~# chmod 750 /usr/sbin/ppplogin
debian:~# chown root:ppp /usr/sbin/ppplogin
5. Set access attributes for /etc/ppp directory:
debian:~# chmod 775 /etc/ppp
debian:~# chown root:root -R /etc/ppp
6. Set access attributes for /usr/sbin/pppd:
debian:~# chmod 750 /usr/sbin/pppd
debian:~# chmod u+s /usr/sbin/pppd
7. Add line at the end of file /etc/inittab if you are using COM1:
S0:2345:respawn:/sbin/mgetty ttyS0
or this line if you are using COM2:
S1:2345:respawn:/sbin/mgetty ttyS1
8. Restart init. This enables the ttyS0 line to accept incoming connections:
debian:~# init q
9. Now add line at the end of file /etc/mgetty/login.config:
/AutoPPP/ - - /usr/sbin/pppd auth +pap -chap login -detach
comment all other lines on this file.
10. Create file /etc/ppp/options.ttyS0 if you are using COM1 or
file /etc/ppp.options.ttyS1 if you are using COM2:
192.168.0.1:192.168.0.50
debug
On first line there are two IP addresses. First assigned for server on
connection and second to client. You can change them according to your IP
numbering scheme.
11. Now try dialing to the server from a client. For this if you are using MS
windows, click dial up networking and then select new connection and fill out
various fields. Login as pppuser with password and verify whether your dialin
server is working perfectly. Check the connection by pinging the server from
client. Also you can verify the ip address assigned to client by typing
winipcfg on command prompt.
Configuration (callback)
Actually there is just small changes to start callback service.
1. Create an empty file /etc/mgetty/callback.conf.
2. Add line at the end of file /etc/mgetty/login.config:
pppuserb - - /usr/sbin/callback -S callback_number
You should change callback_number to your client phone number.
That's all for callback service. Now it's working. And you need only client
configuration.
Configuration (callback client)
As client I use Windows XP professional, but the same configuration is O.K.
for other MS Windows versions.
1. Run your control panel, and open Phone and modem options. On modems tab
select one that you use for connecting to your callback service and press
Properties. Now on advanced tab you see extra initialization commands. Enter
there:
&c0s0=1
2. Now create file callback.scp anywhere on your filesystem:
proc main
waitfor "ogin: "
transmit $USERID
transmit "b^M"
waitfor "ogin: "
transmit $USERID
transmit "^M"
waitfor "assword: "
transmit $PASSWORD
transmit "^M"
endproc
3. Now create new connection as you do using usual ISP. For login use
username 'pppuser' and password. Now go on new connections properties, then
security tab, check the box use script and browse to your created file
callback.scp. That's all now you can just connect to your callback server.
After few seconds it will hang up your connection and redial. For your
computer and for callback server will be assigned IP addresses. You can try
to ping it. Congratulation now you have network connection with callback
server.
NOTICE! I don't cover topics about making your client to reach the internet
access that callback server may have.
Troubleshooting
If you find out some problems related to my tutorial please inform me about
this using e-mail. According to your assistance I will make corrections to
this tutorial and use this troubleshooting section for right way.
About author
My name is Tomas Vilda, I'm living in Lithuania, city Vilnius. I work as
system administrator-programmer on enterprise of J. Denapas "TIGBIS". My
e-mail webmaster@stilius.net. I have wonderful girlfriend Inga that I love so
much. And I want to thank her for making me do something else not just
sitting by computer.
Version
This tutorial was last update on 2003 11 14. You can allways find newest
version on here
Copyrigth
This document is copyrighted to Tomas Vilda. You can use it in all ways, but
don't change this section and allways include it.
Reply to: