dial on demand

8
ÝSTEK ÜZERÝNE BAÐLANTI (DIAL ON DEMAND) Ýstek Üzerine Baðlantý, baðlantý sunucusunun istemciden gelen istek üzerine baðlantý kurmasý; önceden saptanan bir zaman diliminde hiçbir veri akýþý olmamasý durumunda da bu baðlantýyý kendiliðinden koparmasý esasýna dayanmaktadýr. Bu iþ için yaygýn olarak kullanýlan 2 yazýlým bulunmaktadýr: 1- diald 2- pppd  Birinci yöntem, yani diald programýnýn kullanýlmasý halinde bile, pppd demon'u mutlaka kullanýlmak zorundadýr. Oysa pppd'nin yeni sürümlerinde sadece bir parametre kullanýlarak istek üzerine baðlantý kurmak olanaklý hale gelmiþtir. Bu nedenle, yazýmýzda sadece pppd ile baðlantý üzerinde duracaðýz. Anlatacaðýmýz yöntem, hem Slackware 4.0, hem de Slackware 7.0 üzerinde çalýþmaktadýr. Bu sürümlerde /usr/sbin/ dizininde "pppsetup" isimli bir script bulunmaktadýr. (RedHat'ta böyle bir programcýk bulamadým. Diðer daðýtýmlarda olup olmadýðýný da henüz bilmiyorum.) "pppsetup" scriptini çalýþtýrmadan önce bilmemiz gereken bazý ayrýntýlar var: 1- modemimizin baðlý olduðu kapý 2- Modemin hýzý 3- Internet Servis Saðlayýcýmýzýn telefon ve DNS numaralarý 4- Baðlantý ismi ve þifre "pppsetup" komutunu verdiðimizde, önümüze gelen ekrandan, scripti kimin yazdýðýný ve sürüm numarasýný öðreniyoruz: PPPSETUP 1.98 on Slackware Written by Robert S. Liesenfeld <[email protected]> <IRC:Xunil> Changes for 1.98 by Kent Robotti <[email protected]> Patched for Slackware by Patrick Volkerding <[email protected]> Enter tuþu ile sonraki ekrana geçiyoruz: PHONE NUMBER ... 0822 263 0010 Yeni sayfada modemimizin baðlý olduðu kapýyý belirtiyoruz: ttyS3 = (COM4: under DOS) Modemin baðlantý hýzýný veriyoruz( Burada 460800 baud ile 9600 baud arasýnda 7 seçenek var. Yanlarýnda da ne tür baðlantýlara uygun olduðu belirtilmiþ.) Bizim kullandýðýmýz modemin hat hýzý 33600 baud. Bu nedenle baðlantý hýzý olarak 115200 uygun: 115200 115KBps - 28.8, 33.6, or 56Kbps modem... Bu kez bize Servis Saðlayýcýmýzýn geri baðlantý saðlayýp saðlamadýðý soruluyor: Does your service provider use CALLBACK? Yanýtýmýz olumsuz: NO Most Internet providers do not use callback MODEM INIT STRING ...

Upload: 74n3r

Post on 07-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 1/8

ÝSTEK ÜZERÝNE BAÐLANTI (DIAL ON DEMAND)

Ýstek Üzerine Baðlantý, baðlantý sunucusunun istemciden gelen istek üzerinebaðlantý kurmasý; önceden saptanan bir zaman diliminde hiçbir veri akýþýolmamasý durumunda da bu baðlantýyý kendiliðinden koparmasý esasýnadayanmaktadýr.

Bu iþ için yaygýn olarak kullanýlan 2 yazýlým bulunmaktadýr:1- diald2- pppd Birinci yöntem, yani diald programýnýn kullanýlmasý halinde bile, pppd demon'umutlaka kullanýlmak zorundadýr. Oysa pppd'nin yeni sürümlerinde sadece birparametre kullanýlarak istek üzerine baðlantý kurmak olanaklý hale gelmiþtir.Bu nedenle, yazýmýzda sadece pppd ile baðlantý üzerinde duracaðýz.

Anlatacaðýmýz yöntem, hem Slackware 4.0, hem de Slackware 7.0 üzerindeçalýþmaktadýr.

Bu sürümlerde /usr/sbin/ dizininde "pppsetup" isimli bir script bulunmaktadýr.(RedHat'ta böyle bir programcýk bulamadým. Diðer daðýtýmlarda olup olmadýðýnýda henüz bilmiyorum.)

"pppsetup" scriptini çalýþtýrmadan önce bilmemiz gereken bazý ayrýntýlar var:1- modemimizin baðlý olduðu kapý2- Modemin hýzý3- Internet Servis Saðlayýcýmýzýn telefon ve DNS numaralarý4- Baðlantý ismi ve þifre

"pppsetup" komutunu verdiðimizde, önümüze gelen ekrandan, scripti kiminyazdýðýný ve sürüm numarasýný öðreniyoruz:

PPPSETUP 1.98 on SlackwareWritten by Robert S. Liesenfeld <[email protected]> <IRC:Xunil>Changes for 1.98 by Kent Robotti <[email protected]>Patched for Slackware by Patrick Volkerding <[email protected]>

Enter tuþu ile sonraki ekrana geçiyoruz: PHONE NUMBER ...

0822 263 0010

Yeni sayfada modemimizin baðlý olduðu kapýyý belirtiyoruz:

ttyS3 = (COM4: under DOS)

Modemin baðlantý hýzýný veriyoruz( Burada 460800 baud ile 9600 baud arasýnda 7seçenek var. Yanlarýnda da ne tür baðlantýlara uygun olduðu belirtilmiþ.)Bizim kullandýðýmýz modemin hat hýzý 33600 baud. Bu nedenle baðlantý hýzýolarak 115200 uygun:

115200 115KBps - 28.8, 33.6, or 56Kbps modem...

Bu kez bize Servis Saðlayýcýmýzýn geri baðlantý saðlayýp saðlamadýðýsoruluyor: Does your service provider use CALLBACK?Yanýtýmýz olumsuz:

NO Most Internet providers do not use callback

MODEM INIT STRING ...

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 2/8

Kullandýðýmýz "özel" bir modem deðil. Bu nedenle fabrika öndeðerlerinikullanabiliriz: AT&FH0

Enter'le geçiyoruz.

Yeni sayfada Servis Saðlayýcýmýzýn domain adý soruluyor.What is your (I)nternet (S)ervice (P)rovider's domain name ?

garanti.net.tr

Bu kez Servis Saðlayýcýnýn Ad Sunucusu'nun IP numarasý (nameserver IP address):

195.174.219.10

PAP, CHAP, or SCRIPT? ...Does your service provider use PAP or CHAP?PAP seçiyoruz:PAP AUTHENTICATION

PAP or CHAP LOGIN? ...

xxxxxx

Buraya, baðlantý için kullandýðýnýz kullanýcý adýný yazýn.

PAP or CHAP PASSWORD? ...

?????

Parolamýzý da buraya yazýyoruz.

====================================================================These are your PPP configuration files and instructions...====================================================================

#This is your /etc/ppp/pppscript

TIMEOUT 60ABORT ERRORABORT BUSYABORT "NO CARRIER"ABORT "NO DIALTONE""" "AT&FH0"OK "0822 263 0010"TIMEOUT 75CONNECT

# This is your /etc/ppp/options file.

....

Ýþlemler tamamlandý. Sistemimizi hemen kullanmaya baþlayabiliriz. Yine birscript kullanacaðýz:

/usr/sbin/ppp-go

Bu script ile hem doðrudan, hem de istek üzerine baðlantý kurabiliriz:

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 3/8

ppp-go

ppp-go -d

Ýlk komutu verirsek, hemen telefon numarasý çevrilir ve baðlantý kurulmayaçalýþýlýr.

-d parametreli komut ise, "istek üzerine baðlantý" iþlevini tetikler. pppddemonu belleðe yerleþtikten sonra, kullanýcýlardan gelecek istekleri dinlemeyebaþlar. Ýlk istek sinyaliyle hemen telefon numarasý çevrilir ve baðlantýkurulur. Bu durumda, ppp baðlantýsý, /etc/ppp/options.demand dosyasýndabulunan "idle xx" satýrýnda belirlenen xx saniyelik bir süre boyuncahareketsiz kalýrsa, telefon hattý koparýlýr ve yeniden dinlemeye geçilir.

Herþey bu kadar!

pppsetup scripti tarafýndan oluþturulan dosyalar /etc/ppp dizini altýnayerleþir. Yine burada yer alan pppsetup.txt isimli dosyada, oluþturulan

konfigürasyon dosyalarýna iliþkin açýklayýcý bilgiler yer almaktadýr./etc/ppp/pppsetup.txt dosyasýnýn içeriði aþaðýdadýr.

=========================================================================PPPSETUP1.98 on SLACKWARE.

Written by Robert S. Liesenfeld <[email protected]> <IRC:Xunil>Changes for 1.98 by Kent Robotti <[email protected]>Patched for Slackware by Patrick Volkerding <[email protected]>

You should get these docs if you don't already have them:

ftp://metalab.unc.edu/pub/Linux/docs/howto/PPP-HOWTOftp://metalab.unc.edu/pub/Linux/docs/faqs/PPP-FAQ

Press [Enter] to continue with pppsetup...=========================================================================These are your PPP configuration files and instructions...=========================================================================

# This is your /etc/ppp/pppscript.

TIMEOUT 60ABORT ERRORABORT BUSYABORT "NO CARRIER"ABORT "NO DIALTONE""" "AT&FH0"OK "0822 263 0010"TIMEOUT 75CONNECT

# This is your /etc/ppp/options file.

# General configuration options for PPPD:lock

defaultroutenoipdefaultmodem

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 4/8

/dev/ttyS3115200crtscts# Uncomment the line below for more verbose error reporting:#debug# If you have a default route already, pppd may require the other side# to authenticate itself, which most ISPs will not do. To work around this,

# uncomment the line below. Note that this may have negative side effects# on system security if you allow PPP dialins. See the docs in /usr/doc/ppp*# for more information.#noauthpassiveasyncmap 0name "xxxxxx"

I created the symbolic link: /dev/modem -> /dev/ttyS3

# This is your /etc/ppp/options.demand dialing file.

# General configuration options for PPPD:lockdefaultroutenoipdefaultmodem/dev/ttyS3115200crtscts# Uncomment the line below for more verbose error reporting:#debug# If you have a default route already, pppd may require the other side# to authenticate itself, which most ISPs will not do. To work around this,# uncomment the line below. Note that this may have negative side effects

# on system security if you allow PPP dialins. See the docs in /usr/doc/ppp*# for more information.#noauthpassiveasyncmap 0name "xxxxxx"ipcp-accept-localipcp-accept-remote0.0.0.0:10.10.10.10demandconnect "/usr/sbin/chat -v -f /etc/ppp/pppscript"

If you have a ethernet connection you should change the local:remoteIP addresses in the options.demand file, to your actual local andremote address. Example: 215.346.117.89:312.217.187.96

# This in your /etc/resolv.conf file.

search garanti.com.trnameserver 195.174.219.10

195.174.219.10 <-IMPORTANT: This should be the IP address ofyour service providers nameserver.

# This is your /etc/ppp/pap-secrets file.

Look at /etc/ppp/pap-secrets.

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 5/8

Does everything look correct? if not, run 'pppsetup' again...

=========================================================================To connect to your service provider.=========================================================================

~# ppp-go <-Make PPP connection.)

You'll hear and see the modem dialing then once connected,logging you in Username: or Login: and Password: etc.

You won't see a Username or Login: and Password: promptif they're using PAP or CHAP to authenticate you.

If they use PAP or CHAP you'll just see CONNECT -- got it.

If the connection was successful you'll see the Local IP andRemote IP address printed to the screen, you can press [Enter].

If you run ppp-go in X windows you probably won't see a Localand Remote IP address printed to the screen, you'll just seethe connection process come to a end, wait a few seconds andpress [Enter] at that point.

If you don't connect for whatever reason e.g. Failed NoDialtone, Busy, No Carrier, Whatever, Exit, just press[Enter] at that point.

if you have syslogd running, you can see the output messagesfrom pppd and chat in the /var/log/messages and or debug file.

Sample /var/log/messages file.

linax pppd[562]: Serial connection established.linax pppd[562]: Using interface ppp0linax pppd[562]: Connect: ppp0 <--> /dev/modemlinax pppd[562]: local IP address 215.87.78.18linax pppd[562]: remote IP address 205.94.97.35

You don't have a successful PPP connection until youreceive a local & remote IP address like above.

If you have the X window system, you could connect in a Xterm.

linax # startxlinax # ppp-golinax # netscape mosaic etc.

~# ppp-off <-To end the ppp connection.)

~# ppp-go -h <-For help.)

There is no support in linux for "WinModems", if you have aWinModem you will not be able to use it in linux.

There is support for plug n play modems, if you have a pnpmodem you may need "isapnptools" to get it recognized.

=========================================================================#### Look at the /usr/doc/pppsetup/pppsetup-1.98.README. ####

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 6/8

#### A copy of this text can be found in: /etc/ppp/pppsetup.txt ####=========================================================================

Done... You can exit now...

End...=========================================================================

PPP-2.3.0 and later has a demand dialing option, you can use it this way,the options file for demand dialing will be /etc/ppp/options.demand.

Start ppp-go -d, pppd will just stay in the background until you try toconnect to some site, then pppd will dial your service provider and makethe ppp connection.

~# ppp-go -d <-Start pppd this way for demand dialing.)# <-It should drop you back to #.) ~# ftp ftp.funet.fi <-Pppd will start dialing.)# lynx http://www.foo.com <-Pppd will start dialing etc.)

# ppp-off -d <-To end and restart pppd in demand dialing mode.)# ppp-off <-To end the ppp connection.)

End...=========================================================================These are some other ways to make a PPP connection.

The best way to make a PPP connection is to create a chat script, ifyou're having trouble with the chat script you can use these methodsbelow to make the PPP connection.

You can also use these methods below to see what's going on when youconnect to your service provider, i.e. what do they require, do they

present you with a Login: or Username: and Password: prompt etc.

What steps do you have to go through before they start PPP at thereend?

First make sure the IP address of your service providers nameserveris in the /etc/resolv.conf file.

nameserver 205.117.312.56 <-For example.) =========================================================================Using 'dip' to make the PPP connection.=========================================================================

~# dip -tvHost name lookup failure

If you get the above messgae when you start 'dip', it's because youdon't have your hostname in the /etc/hosts file.

~# hostnamefoobar

If your hostname were 'foobar' you should put it in the /etc/hosts file.

127.0.0.1 localhost0.0.0.0 foobar.localnet foobar

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 7/8

~# dip -tvdip> port /dev/ttyS1can't open - problems with locking ttyS1

If you get the above message after "port /dev/modem", it means you have alock file in /var/lock/LCK..ttyS1, remove the lock file and kill dip.

~# rm /var/lock/LCK*# killall -9 dip

~# dip -tv

dip> port /dev/ttyS1 <-Where's the modem? ttyS0 = com1 ttyS1 = com2 etc.)dip> speed 115200 <-Modem speed: 19200 38400 57600dip> term

at&fw2 <-Modem init string.)atdt1234567 <-Replace 1234567 with the phone number.)

Usally you give your username and password then ppp is started, ifthey use PAP or CHAP you probably won't be asked for a username andpassword, they will just say that PPP has been started or nothing.

Press Ctrl ] to exit dip term mode when PPP is started at their end.

dip> default <-Use default route.)dip> mode ppp <-Start PPP at your end.)

~# ping metalab.unc.edu <-To see if you're connected.)

~# dip -k <-To kill dip and the PPP connection.)

=========================================================================Using 'minicom' to make the PPP connection.=========================================================================

Keep the /etc/ppp/options file that was created by pppsetup, it shouldhave at least these options in it.

lockdefaultroutenoipdefault/dev/ttyS1 <- ttyS0 = com1 ttyS1 = com2 ttyS2 = com3 ttyS3 = com4

57600modemcrtsctsdebugasyncmap 0

~# minicom -m -s

at&fw2atdt1234567

Press Alt Q to exit minicom without reset after PPP is started atthe other end.

~# pppd <-Start PPP at your end.)

8/6/2019 Dial on Demand

http://slidepdf.com/reader/full/dial-on-demand 8/8

~# ppp-off <-To end the PPP connection.)# killall -INT pppd <-If you don't have 'ppp-off' end it this way.)

End...=========================================================================

Son olarak, ppp-go ile kurulan baðlantýyý devre dýþý býrakmak istediðimizde

kullanacaðýmýz scripti de belirtelim: ppp-off.

Baðlantýnýn gerçekleþip gerçekleþmediðinden emin olmak istiyorsanýz aþaðýdakikomutu seveceksiniz:tail -f /var/adm/messages &

Hepsi bukadar! Umarým bir-iki sorunuzu yanýtlamýþýmdýr!

Ahmet Aksoy19991214

Öneri ve eleþtirileriniz için lütfen [email protected] adresinikullanýnýz.