>> Read No. 2190 article  
하나로 ADSL과 IP 매스커레이딩 설정 방법

등록 2002-02-06 00:51:00     조회 4
이름 이강산    

		안녕하세요.
요 며칠 리눅스 서버를 만들려고 이곳저곳 기웃거리다가 겨우 완성했습니다.
정보들이 여러군데 흩어져 있어서 이곳에 모아봅니다.
  환경 : 하나로 ADSL lite
         SpeedWarp HD3100 (외장형 모뎀)
         PC#1 : 펜티엄 133 , 램 64메가, 하드디스크 1기가 , 와우리눅스 7.0 까치
         PC#2 : 셀러론 600 , 램 256메가,하드디스크 40기가, 윈도우 2000
         Lan card : 리얼텍 RTL8139 3장
 목적 : PC#1에 리눅스를 설치하고 ADSL 을 설정한 후,
         마스커레이딩을 이용하여 PC#2에서도 원활히 인터넷을 사용한다.
 방법 :
 1. PC#1에 리눅스를 설치한다.
 제 경우에는 하드디스크 용량이 부족해서 한컴리눅스 2.2 나 미지리눅스 2.0은
설치할 수 가 없더군요. 그래서 선택한 것이 와우리눅스 7.0
 2. rp-pppoe 와 ppp 패키지를 설치한다.
 와우리눅스 7.0 까치에는 rp-pppoe-2.5-1 과 ppp-2.3.11-7 이 들어있는데,
ADSL 이 특성을 타는지 잘 동작하지 않았습니다.
그래서 한컴 2.2 배포판에 들어있는 rp-pppoe-3.31hl 와 ppp-2.4.1-2hl 를
설치하였습니다.  잘~ 되더군요.
 이하의 설명은 와우리눅스 홈페이지의 정보광장에 있는 내용입니다.
아주 훌륭히 설명되어 있기 때문에 대부분 그대로 옮깁니다.
다만, 한두가지 설정이 잘못 된 부분만 수정하도록 하겠습니다.
 --
 차  례
1. 클라이언트로 이용시
2. standalone 사용시
3. 매스커레이딩 사용시
4. 필자의 사용사례
 1. 클라이언트로 이용시 (랜카드가 하나이고, 직접 연결하여 사용할 경우)
 
 1-1. 리눅스 설치
 리눅스 설치시 랜카드 방식을 물어볼 때 (클라이언트로 사용, 매스커레이딩 사용하지 않
음) DHCP가 아닌 고정아이  피를 준다.(192.168.0.1) 그 다음 모든 설치가 끝나고 리부팅을 시킨
다.  1-2. ADSL Setup
 한텀 혹은 콘솔에서
     # adsl-setup
 을 실행한다.
 Welcome to the Roaring Penguin ADSL client setup.  First, I will run
 some checks on your system to make sure the PPPoE client is installed
 properly...
  
 Looks good!  Now, please enter some information:
  
 USER NAME
 >>> Enter your PPPoE user name (default alponce): <= 여기에 하나로 아이디를 넣어 줍니다.
                                                                            ex) us
erid@hanaro  INTERFACE  >>> Enter the Ethernet interface connected to the ADSL modem
 (default eth1):eth0 <= 랜카드가 하나일 경우, 필자는 두 개이고 매스커레이딩을 하였습니다.
 
 Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped.  If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses.  You may have some problems with demand-activated links.
 >>> Enter the demand value (default no): <= 그냥 엔터를 치면 됩니다...
  Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
 >>> Enter the DNS information here:210.220.163.82 <= 하나로 DNS를 넣어 줍니다..
 
 Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
 >>> Enter the secondary DNS server address here: 210.94.6.67 <= 보조 DNS입니다.
 
 PASSWORD
 >>> Please enter your PPPoE password: <= 패스워드를 넣어 줍니다..
 >>> Please re-enter your PPPoE password:  <= 다시 한번 넣어 줍니다...
 
  
 FIREWALLING
 Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.  If you
are using SSH, the rules will block outgoing SSH connections which
 allocate a privileged source port.
  
 The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
     for ensuring the security of your machine.  You are STRONGLY
     recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
     for a LAN
 >>> Choose a type of firewall (0-2): 0 <= 일단 0을 선택합니다.
 
    ** Summary of what you entered **
     Ethernet Interface: eth0
    User name:          userid@hanaro     Activate-on-demand: No
    Primary DNS:       168.126.63.1
    Secondary DNS:     168.126.63.2
    Firewalling:       STANDALONE
 >>> Accept these settings and adjust configuration files (y/n)? <= y를 입력합니다.
      Adjusting /etc/ppp/pppoe.conf
     Adjusting /etc/resolv.conf
     Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
     (But first backing it up to /etc/ppp/pap-secrets-bak)
     (But first backing it up to /etc/ppp/chap-secrets-bak)
 
 1-3. 파일의 편집
 여기까지 한 다음 몇가지 파일을 편집하여야 합니다.
 /etc/ppp/pppoe.conf 파일의 설정을 수정합니다. 하나로 ADSL을 rp-pppoe 패키지로 접속하기 위해서
는 옵션이 한  가지 추가되어야 합니다. 이 옵션이 없으면, 접속이 안될 수도 있습니다.
 /etc/ppp/pppoe.conf 파일의 끝에 보면 다음과 같은 부분이 보입니다.
 # Any extra arguments to pass to pppoe.  Normally, use a blank string
 # like this:
 PPPOE_EXTRA=""
 
 여기에서,
 PPPOE_EXTRA="-S pppoe"
 
 라고 써줍니다. 대소문자를 구분하니 주의하시기 바라구요.
 마지막으로
     # adsl-start
 라고 입력하세요.
 그러면, 연결되었다고 나올 것입니다.
  
 2. standalone 사용시   (랜카드가 하나이고 직접 연결하여 사용할 경우)
 
 2-1. 파이어월의 설정
 FIREWALLING
 Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.  If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.
 The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
     for ensuring the security of your machine.  You are STRONGLY
     recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
     for a LAN
 >>> Choose a type of firewall (0-2): 0 <= 1일 경우...
  
 
 여기서 1이나 2를 선택한 사람은 파이어월 설정파일을 생성해야 합니다. 이 문서에 딸려있
는 firewall-standalone 파  일을 그대로 사용하셔두 무방하구요. 아니면 다음의 파일을 만드셔
두 됩니다.  이 파일은 /etc/rc.d/init.d 밑에 firewall이라는 이름으로 위치해야 합니다.
     #!/bin/sh
    #
    # firewall-standalone   This script sets up firewall rules for a standalone
    #                       machine
    #
    # Copyright (C) 2000 Roaring Penguin Software Inc.  This software may
    # be distributed under the terms of the GNU General Public License, version
    # 2 or any later version.
     # Interface to Internet
    EXTIF=ppp+
     ANY=emoticon.0.0/0
     ipchains -P input ACCEPT
    ipchains -P output ACCEPT
    ipchains -P forward DENY
     ipchains -F forward
    ipchains -F input
    ipchains -F output
     # Deny TCP and UDP packets to privileged ports
    ipchains -A input -l -i $EXTIF -d $ANY 0:1023 -p udp -j DENY
    ipchains -A input -l -i $EXTIF -d $ANY 0:1023 -p tcp -j DENY
 
 2-2. 실행
 그 다음은 당연히
     #adsl-start
 를 실행시키면 연결이 됩니다.
  
 3. 매스커레이딩 사용시
 
 랜카드가 하나 이상이고, eth0가 외부와 연결되고 eth1이 내부에 연결 <== 요것이 제가 구성
할 환경.  eth0 : 192.168.0.1
 eth1 : 192.168.1.1      (eth0 와 eth1 이 서로 다른 서브넷에 위치하도록 설정)
 3-1. 네트워크 카드 설정
 INTERFACE
  
 >>> Enter the Ethernet interface connected to the ADSL modem
 (default eth1):eth0 <= eth0 이 ADSL 외장모뎀과 연결
 
  
 3-2. 파이어월의 설정
 FIREWALLING
 Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.  If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.
 The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
     for ensuring the security of your machine.  You are STRONGLY
     recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
     for a LAN
>>> Choose a type of firewall (0-2): 0 <= 2일 경우...
  여기서, 2를 선택한 사람은 파이어월 설정파일을 생성해야 합니다.
이 문서에 딸려있는 firewall-masq 파일을 그대로 사용하셔두 무방하구요... 아니면 다음의 파
일을 만드셔두 됩니다.  이 파일은 /etc/rc.d/init.d 밑에 firewall 이라는 이름으로 위치해야 합
니다.      #!/bin/sh
    #
    # firewall-masq         This script sets up firewall rules for a machine
    #                       acting as a masquerading gateway
    #
    # Copyright (C) 2000 Roaring Penguin Software Inc.  This software may
    # be distributed under the terms of the GNU General Public License, version
    # 2 or any later version.
     # Interface to Internet
    EXTIF=ppp+
     ANY=emoticon.0.0/0
     ipchains -P input ACCEPT
    ipchains -P output ACCEPT
    ipchains -P forward DENY
     ipchains -F forward
    ipchains -F input
    ipchains -F output
     # Deny TCP and UDP packets to privileged ports
    ipchains -A input -l -i $EXTIF -d $ANY 0:1023 -p udp -j DENY
    ipchains -A input -l -i $EXTIF -d $ANY 0:1023 -p tcp -j DENY
     # Deny TCP connection attempts
    ipchains -A input -l -i $EXTIF -p tcp -y -j DENY
     # Deny ICMP echo-requests
    ipchains -A input -l -i $EXTIF -s $ANY echo-request -p icmp -j DENY
     # Do masquerading
    ipchains -A forward -j MASQ
     echo 1 > /proc/sys/net/ipv4/ip_forward
  [주의] ipchains -A input -l -i $EXTIF -d $ANY 0:1023 -p udp -j DENY
에서 input 다음의 옵션은 소문자 L입니다.
  3-3. 실행
 그 다음은 당연히
     # adsl-start
 를 실행시키면 연결이 됩니다.
  
 3-4. 매스커레이팅 머신에 물린 클라이언트 설정
 클라이언트 들의 IP 주소는 192.168.1.2~254 중 아무거나 쓰시면 됩니다.
리눅스 머신에 물린 다른 머신들의 네임서버는 리눅스머신에 네임서버가 설치되어 있다면
 리눅스머신으로 잡아 주  면(192.168.1.1) 됩니다. 만일 네임서버가 설치되지 않았다면 하나
로 네임서버(210.220.163.82)을 잡아주면 됩니다  . 클라이언트에서 게이트웨이는 클라이언트
와 연결된 서버 랜카드의 IP로 지정해 줍니다. (192.168.1.1) ADSL로 연  결되는 리눅스 머신에서
는 게이트웨이를 설정할 필요가 없습니다.   4.  필자의 사용사례
 
    ADSL ----  lan card  [ PC#1 ] lan_card  ------  lan_card [ PC#2 ]
                    192.168.0.1          192.168.1.1         192.168.1.2
  adsl-start 이전의 라우팅 테이블은 아래와 같고,
 [root@onesarts init.d]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0        0     0   eth1
192.168.emoticon     *               255.255.255.0   U     0        0     0   eth0
127.emoticon.0       *               255.emoticon.0       U     0        0     0   lo
 adsl-start 이후의 라우팅 테이블은 아래와 같습니다.
 [root@onesarts init.d]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
211.108.29.1    *               255.255.255.255 UH    0      0        0 ppp0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
192.168.emoticon     *               255.255.255.0   U     0      0        0 eth0
127.emoticon.0       *               255.emoticon.0       U     0      0        0 lo
default         211.108.29.1    emoticon.0.0         UG    0      0        0 ppp0
 --
 이상입니다. 필요하신 분들께 도움이 되길 바랍니다.
 --
뒈져라, 부시 !!
이름
암호
  목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.86 초 ] 작업시간: [ 0.06 초 ]

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved
[TOP]

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1791038291
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.