7.0 버전에서는 ADSL 설정에 필요한 pppoe 프로그램이 이미 설치되어 있어, 몇몇
간단한 명령으로 쉽게 adsl에 접속할 수 있게 되었습니다. 여기서는 단독으로 리눅스에서
ADSL 에 연결하는 방법과, 매스커레이딩을 이용하여, 홈네트워킹을 구현하는 방법을
간단히 소개하려 합니다.
차 례
1.
클라이언트로 이용시
2.
standalone 사용시
3.
매스커레이딩 사용시
4.
6.2 사용시
5.
필자의 사용사례
파일 다운로드
1.
ppp.tar.gz : firewall등 설정에 필요한 파일 모음
2.
rp-pppoe-2.5-1.i386.rpm : 설치가 되지 않은 사용자나, 6.2 버전 사용자가 설치할
프로그램
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): <=
여기에 한통 아이디를 넣어 줍니다.
|
|
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:168.126.63.1 <=
한국통신 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: 168.126.63.2
<= 보조 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: lsy1974
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=""
|
여기에서,
라고 써줍니다. 대소문자를 구분하니 주의하시기 바라구요.
마지막으로
# adsl-start
라고 입력하세요.
그러면, 연결되었다고 나올 것입니다.
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=0.0.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
를 실행시키면 연결이 됩니다.
랜카드가
하나 이상이고, eth0가 외부와 연결되고 eth1이 내부에 연결
eth0 : 192.168.0.1
eth1 : 192.168.0.2
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=0.0.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
# Do masquerading
ipchains -A forward -s 192.168.0.2/32
-j MASQ
ipchains -A forward -s 192.168.0.3/32
-j MASQ
ipchains -A forward -s 192.168.0.4/32
-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. 매스커레이팅 머신에 물린 클라이언트 설정
리눅스 머신에 물린 다른 머신들의 네임서버는 리눅스머신에 네임서버가 설치되어
있다면 리눅스머신으로 잡아 주면(192.168.0.2) 됩니다. 만일 네임서버가 설치되지
않았다면 한통 네임서버(168.126.63.1)을 잡아주면 됩니다. 클라이언트에서 게이트웨이는
ADSL 모뎀과 연결된 랜카드의 IP로 지정해 줍니다. (192.168.0.1) ADSL로 연결되는
리눅스 머신에서는 게이트웨이를 설정할 필요가 없습니다.
rp-pppoe 2.2-4 패키지를 설치한 다음 위의 과정을 순서대로 진행하면 됩니다.
설정 파일이 아래의 설정을 반영한 것이므로, 참고 하시면 이해가 쉬울 것 같아
그려 보았습니다.
글쓴이 : 정낙수 님
(본 문서는 와우리눅스 7.0 및 한컴리눅스 1.2를 기준으로 만들었으며, 본 문서의
저작권은 본인(정낙수)에게 있습니다. 사전동의없이 사용하여도 무방하며 사용할
때 그냥 저자의 이름을 명시해 주세요.) |