다음 이전 차례

3. 리눅스 박스에서 Diald 설치 및 설정

3.1 준비물

3.2 Diald 받아오기

Redhat 미러사이트인 보라넷에서 받습니다.

ftp://ftp.bora.net/pub/Linux/redhat-contrib/libc6/i386/ 에서

diald16-0.16.5a-2.i386.rpm 
diald16-config-0.16.5a-2.i386.rpm 

화일을 다운로드 받습니다.

[kskim@ja kskim]$ ncftp ftp.bora.net  [Enter]
bora> cd /pub/Linux/redhat-contrib/libc6/i386/ [Enter]
bora> mget diald16* [Enter]           <---- 이러면 받기 시작합니다.
bora> bye {Enter]                     <---- 모두 받고나면 종료합니다.

[kskim@ja kskim]$ ls -l  [Enter]
total 19431
-rw-r--r--  1 kskim   kskim  159038 Mar 28 20:53 diald16-0.16.5a-2.i386.rpm
-rw-r--r--  1 kskim   kskim    6233 Mar 28 20:54 diald16-config-0.16.5a-2.i386.rpm

이제 받아져 있는 것을 확인할수 있습니다.

3.3 Diald 설치

root 계정으로 설치 하셔야 합니다.

[kskim@ja kskim]$ su   [Enter]
Password:              <--- root 패스워드입력후 [엔터]

[root@ja kskim]# rpm -Uvh diald16* [Enter]

하시면 설치가 되었습니다.

[root@ja kskim]# cd /etc/diald  [Enter]
[root@ja diald]# ls -l  [Enter]        <--- 확인해 보면
total 14
-rwx------   1 root     root         3414 Apr 20 12:38 connect*
-rw-r--r--   1 root     root         1342 May  3 09:50 diald.conf
prw-rw----   1 root     wheel           0 May  3 11:46 diald.ctl|
-rw-r--r--   1 root     root         1235 Mar 28 13:51 diald.defs
-rw-r--r--   1 root     root         5905 May  3 09:56 phone.filter

그리고 나서 diald.conf를 /etc 디렉로리에 심볼릭링크 시킵니다.

[root@ja diald]# cd /etc [Enter]
[root@ja etc]# ln -s /etc/diald/diald.conf /etc/diald.conf [Enter]
그러면 conf 화일까지 끝.

3.4 diald.conf 화일 수정

/etc/diald.conf 화일을 수정합니다.


# 
# diald.conf for anathoth
#
# Select the demand dial rules you want
# Bring the link up for anything, timeout in seconds. Use this for 
# when the dompute has its own phone line
accept any 420 any                        <---- 이부분을 '#'로 막습니다.
#accept any 420 any                       <---- 이렇게..
# Use the filter file that comes with diald.  This can be a bit drastic, 
# so use the filter below
# include /usr/lib/diald/standard.filter
# or use the filter that brings the link up for use on a line shared with
# a phone
# include /etc/diald/phone.filter         <---- 이부분을 '#'를 지웁니다.
include /etc/diald/phone.filter           <---- 이렇게...

# stuff to set up the diald connection
#device /dev/modem       <--- 이부분을 자신에게 맞게 바꿉니다.
device /dev/ttyS1        <--- 이렇게.. (자신의 ISDN TA나 모뎀 연결포트 여기서는 Com2)
speed 115200             <--- TA나 모뎀의 속도 여기서는 115200bps
lock
mode ppp
# We may get another terminal server, thus use
# 'dynamic' and do not tell PPP the IP number of the other end
# For use with gated, comment out the 'dynamic' option, and
# set remote to be the same as local
dynamic
local 10.0.0.1
remote 10.0.0.2
# pppd-options name anappp :                  <---- 이부분을 
pppd-options asyncmap 00000000 name bs0600 :  <---- 이렇게...  ......
                                                               자신이 가입한 ISP의 접속 ID(계정)
# Delay sending packets for 5 seconds after PPP device opens - 
# this allows routes to be established back to the appropriate dialup server.
up-delay 5
defaultroute    
modem
crtscts
connect /etc/diald/connect
redial-timeout 10
fifo /etc/diald/diald.ctl
# restrict 9:00:00 17:45:00 1 * *
# or-restrict 9:00:00 17:45:00 2 * *
# or-restrict 9:00:00 17:45:00 3 * *
# or-restrict 9:00:00 17:45:00 4 * *
# or-restrict 9:00:00 17:45:00 5 * *
# up

device 설정시 사용하는 시리얼포트 설정은 다음과 같습니다.

com1   --->   /dev/ttyS0
com2   --->   /dev/ttyS1
com3   --->   /dev/ttyS2
com4   --->   /dev/ttyS3

자세한 내용은 Serial-HOWTO문서를 참고하십시오.

3.5 connect화일 수정

그리고 수정할 화일은 /etc/diald/connect 입니다.


#!/bin/sh
# Copyright (c) 1996, Eric Schenk.
#

--- 중간 생략 ---

# The initialization string for your modem

#MODEM_INIT="ATZ&C1&D2%C0"    <---- 이부분을 자신에게 맞게 바꿉니다. 모뎀초기화 명령
MODEM_INIT="ATB40&J3"         <---- 이렇게.. (이것은 ISDN TA의 MLPPP 제어명령)

# The phone number to dial
#PHONE_NUMBER="999111999"     <---- 이부분을 
PHONE_NUMBER="01414"          <---- 이렇게 ... (이것은 코넷ISDN접속번호)

--- 중간 생략 ---

# Success!
message "Protocol started"

ISDN으로 인터넷에 128K접속을 하려면 ISDN TA가 MultiLink PPP 모드로 설정되어야 합니다. ISDN 외장TA의 MultiLink PPP 제어명령은 단말기제조회사마다 틀립니다. 여기서는 뉴텍의 ``옴니''모델 초기화명령입니다. 접속전화번호는 ISP(인터넷가입업체)마다 틀립니다. 여기서는 코넷의 접속번호를 적었습니다.

모뎀으로 연결시에는 초기화명령에 'ATZ'라고 적으시면 무리가 없습니다.

3.6 Passwd설정

그리고 ISP 접속을 위한 Passwd설정을 해야 합니다.

인터넷접속이 가능하다면 이부분은 벌써 설정이 되어 있을 수도 있습니다. 만약 설정이 안되어있다면 설정을 합니다.

ISDN으로 ISP로 연결하거나 윈도우95로 연결시 사용하는 방식이 PAP 인증 방식입니다.

수정할 화일은

/etc/ppp/pap-secrets            - Passwd를 설정하는 화일 입니다.
입니다.

/etc/ppp/pap-secrets 화일 내용입니다.


# Secrets for authentication using PAP
# client        server  secret                  IP addresses

bs0600          *       1234      - 이런식으로 적어주면 됩니다.
jungang         *       1234      - 다른 계정이 또 있다면...
jungang         ppp0    1234
jungang         ppp1    1234

ID가 bs0600 패스워드가 1234라면 위와 같이 적어줍니다. 그러면 한번 확인해 보겠습니다.

[kskim@ja ppp]# ls -l
total 5
-rw-------   1 root     daemon       78 Jun  8  1998 chap-secrets
-rwxr-xr-x   1 root     root        265 Oct 16  1998 ip-down*
-rwxr-xr-x   1 root     root        349 Oct 16  1998 ip-up*
-rw-r--r--   1 root     daemon        5 Jun  8  1998 options
-rw-------   1 root     daemon      300 Apr 16 10:13 pap-secrets    <---- 이화일이 수정되었습니다.

3.7 리눅스 DNS설정

그리고 인터넷을 올바로 활용하려면 DNS (도메인네임서버) 설정을 해야 합니다. 도메인 주소 예를 들자면 soback.kornet.net을 168.126.3.3 라는 IP주소로 번역을 해주는 역할을 합니다.

수정할 화일은 /etc/resolv.conf


search kt.co.kr co.kr com    <---- 뒷부분을 생략했을 때 찾아보는 도메인
nameserver 127.0.0.1         <---- 리눅스박스에서 자체 네임서버를 운영할 경우
nameserver 168.126.63.1      <---- 사용하는 ISP의 DNS주소 여기서는 코넷의 경우
nameserver 168.126.63.2      <---- 사용하는 ISP의 보조DNS주소

리눅스 박스에서 DNS 데몬을 띄우지 않는다면 127.0.0.1 을 적지 마세요. 그리고 여기서 DNS주소는 인터넷서비스를 받는 ISP로 문의하시면 알수 있습니다.

3.8 phone.filter 수정

필요하신분은 수정하시기 바랍니다. 이화일은 ``특정 패킷사용후 얼마의 시간이 경과한 후 접속을 끊을 것인가?'' 를 설정하는 역할을 합니다. 단위는 초 입니다.

이부분은 저도 정확히 모르겠습니다. /usr/doc/diald16-0.16.5a/ 안에 설명이 있으니 참조하시기 바랍니다.

수정할 화일은 /etc/diald/phone.filter 입니다.


# This is a pretty complicated set of filter rules.
# (These are the rules I use myself.)
#

 --- 중간생략 ---

# NOTE: Your /etc/services may not define the tcp service www, in which
# case you should comment out the following two lines or get a more
# up to date /etc/services file. See the FAQ for information on obtaining
# a new /etc/services file.
accept tcp 240 tcp.dest=tcp.www  <--- 웹사용시 사용이 끝난 후 240초가 
accept tcp 240 tcp.source=tcp.www            경과하면 전화를 끊습니다.

# Once the link is no longer live, we try to shut down the connection
# quickly. Note that if the link is already down, a state change
# will not bring it back up.
keepup tcp 5 !tcp.live
ignore tcp !tcp.live

# an ftp-data or ftp connection can be expected to show reasonably frequent
# traffic.
accept tcp 240 tcp.dest=tcp.ftp    <--- FTP사용후 240초가 경과하면 접속을 끊습니다.
accept tcp 240 tcp.source=tcp.ftp

 --- 중간생략 ---

# If we don't catch it above, give the link 10 minutes up time.
# accept tcp 600 any
accept tcp 300 any   <--- 10분이 길어서 5분으로 바꿨습니다.

 --- 중간생략 ---

# Anything else gest 2 minutes.
accept udp 120 any

# Catch any packets that we didn't catch above and give the connection
# 30 seconds of live time.
accept any 30 any     <--- 정의되지 않은 것들은 2분후 접속을 끊습니다.

3.9 Diald 실행

이제 Diald를 실행합니다.

[root@ja diald]# /etc/rc.d/init.d/diald start  [Enter]

Diald 종료는

[root@ja diald]# /etc/rc.d/init.d/diald stop  [Enter]

치시면 됩니다. 실행후 제대로 연결되었는지 Ping Test를 해봅니다.

[kskim@ja kskim]$ping home.hitel.net  [Enter] 후 조금 기다리세요
PING home.hitel.net (203.245.15.254): 56 data bytes
64 bytes from 203.245.15.254: icmp_seq=0 ttl=249 time=117.7 ms
64 bytes from 203.245.15.254: icmp_seq=1 ttl=249 time=60.1 ms
64 bytes from 203.245.15.254: icmp_seq=2 ttl=249 time=60.1 ms
64 bytes from 203.245.15.254: icmp_seq=3 ttl=249 time=60.1 ms
64 bytes from 203.245.15.254: icmp_seq=4 ttl=249 time=60.1 ms
64 bytes from 203.245.15.254: icmp_seq=5 ttl=249 time=60.1 ms
64 bytes from 203.245.15.254: icmp_seq=6 ttl=249 time=60.1 ms
64 bytes from 203.245.15.254: icmp_seq=7 ttl=249 time=70.1 ms

--- home.hitel.net ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 60.1/68.5/117.7 ms

전화가 걸려가고 위와 같이 잘 동작 합니다. 실행되었는지는 아래 명령으로 확인가능합니다.

[kskim@ja kskim]$/sbin/ifconfig
lo       Link encap:Local Loopback  
         inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
         UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
         RX packets:7329 errors:0 dropped:0 overruns:0 frame:0
         TX packets:7329 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 

eth0     Link encap:Ethernet  HWaddr 00:60:97:5B:1A:BD  
         inet addr:168.248.138.150  Bcast:168.248.138.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:168416 errors:4 dropped:0 overruns:0 frame:7
         TX packets:202300 errors:0 dropped:0 overruns:0 carrier:201
         collisions:2479 
         Interrupt:10 Base address:0x6400 

sl0      Link encap:Serial Line IP         <---- 실행된것을 나타냅니다. 가상 디바이스입니다.
         inet addr:10.0.0.1  P-t-P:10.0.0.2  Mask:255.0.0.0
         UP POINTOPOINT RUNNING  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 

ppp0     Link encap:Point-to-Point Protocol    <--- 지금 전화가 걸린 상태입니다.
         inet addr:168.126.43.10  P-t-P:168.126.43.2  Mask:255.255.0.0
         UP POINTOPOINT RUNNING  MTU:1500  Metric:1
         RX packets:1204 errors:0 dropped:0 overruns:0 frame:0
         TX packets:1382 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 
         Memory:2bd9038-2bd9c04 

[kskim@ja kskim]$/sbin/route
Kernel IP routing table
Destination     Gateway  Genmask         Flags Metric Ref  Use Iface
10.0.0.2        *        255.255.255.255 UH    1      0      0 sl0<p>
168.126.43.2    *        255.255.255.255 UH    0      0      0 ppp0
168.248.138.0   *        255.255.255.0   U     0      0    314 eth0
127.0.0.0       *        255.0.0.0       U     0      0     28 lo
default         *        0.0.0.0         U     0      0     35 ppp0  <--- ISP에 접속됨
default         *        0.0.0.0         U     1      0     80 sl0   <--- 가상 디바이스


다음 이전 차례