'리눅스'에 해당되는 글 2건

  1. 2007.02.08 리눅스 삭제
  2. 2006.08.10 리눅스에서의 인터넷 공유
engineering/System Eng.2007. 2. 8. 13:32

[리눅스 삭제]

리눅스 삭제는 리눅스내에서 fdisk를 이용해 삭제해야합니다.

윈도우 FDISK나 CD로 한다면 삭제하지 못할 경우도 있습니다.


1. root로 로그인


2. # fdisk  /dev/hda 입력

fdisk에서 명령을 내릴 수 있는 프롬프트가 나타납니다.


3. Command  (m for help) : p 입력

하드디스크 분할 영역 정보가 출력됩니다.

/dev/hda1 영역은 남기고 나머지를 삭제합니다.


4. Command  (m for help) : d 입력

Partition number  (1 - 7) : 삭제하고자 하는 분할 영역 숫자를 입력하면 됩니다.

다시 파티션 정보를 보려면 p 입력

방금 삭제한 분할영역이 없을겁니다.

이런식으로 /dev/hda1 영역을 제외한 나머지를 삭제합니다.

다 삭제했으면 저장하고 나가기 위해 w 입력합니다.

** 만약 분할영역 삭제를 잘못 진행했을 경우 q를 입력해 저장하지 않고 빠져나오세요.

그리고 처음부터 다시 진행하면 됩니다.


5. 마지막으로 MBR 영역에 남은 LILO를 삭제해야합니다.

# lilo -u 입력

** 만약 부트로더를 Grub로 설치했을 경우 lilo로 바꿔준 다음 삭제합니다.

# /sbin/lilo 입력


6. 이제 리눅스 삭제는 완료되었고 CMOS에서 부팅 순서를 정해 윈도우로 부팅하면 됩니다.

FDISK나 윈도우 CD로 부팅해서 파티션 분할, 포맷하고 설치하면 됩니다.


** 만약 부트로더(LILO,Grub)를 삭제하지 않고 윈도우를 설치했다면 윈도우로 부팅이 안될겁니다.

부트로더를 제거해야합니다.


윈도우 부팅 디스켓을 이용해서 MBR 영역을 삭제할 때

A: > fdisk  /mbr

Grub라면 (shift + F5)

A:\ > fdisk /mbr


** 윈도우 CD를 이용해서 MBR 영역을 삭제할 때

윈도우 CD로 부팅

R 입력 --> 복구콘솔

C:\ fixmbr 실행  --> yes

C:\ fixboot 실행 -->exit 입력하고 복구콘솔 종료하면 삭제됩니다.


//추가 답변//

PXE-E61 : Media test failure, check cable

부팅시 LAN으로 부팅될 때 나타나는 메세지입니다.

CMOS에서 부팅 순서를 다시 잡아 보시고 LAN 부팅은 사용안함으로 설정해보세요.

그래도 안될 경우 하드디스크 캐이블 다시 한번 점검하고,

다른 컴퓨터에서 테스트 해보는 것도 좋을겁니다.

Posted by theYoungman
engineering/Network Eng.2006. 8. 10. 14:52
출처 블로그 > 지독한 잠수 증후군들..
원본 http://blog.naver.com/kazamia/40000362694

리눅스에서 한개의 전용선으로 인터넷 연결 공유 하기


IP 공유는 ADSL 한 개의 회선을 가지고 여러대의 컴퓨터가 통신을 사용하는 것이며 아직 한국통신에서는 불법이라고하고 있지만 정보통신부에도 공식적으로 IP공유를 허가 하는 것으로 방향을 잡았으며 곧 이 약관이 개정이 될 것으로 예상된다.

공유 할 수 있는 프로그램은 상용 위도우용 프로그램도 있지만 리눅스를 이용하면 무료이며 윈도우용프그램보다 훨씬 많은 기능과 장점을 가지고 있다.

설치에 들어가기 전 기본적으로 알아야 할 것들을 알아보자.

인터넷은 TCP/IP 프로토콜이라는 것을 통해 통신이 되는 데
인터넷에 접속되는 컴퓨터에 중복되지 않는 IP 주소라는 것을 할당하여
통신을 하고 있으며 이 IP주소 각각의 컴퓨터를 구분 구분 할 수 있는
주소와 같은 것이다.

IP주소는 .(점)으로 구분되는 (예 211.202.265.25 )  4개의 숫자들로 구성되어 있으며 전용선 사용자들은 고정IP을 할 당 받지만
ADSL이나 모뎀 사용자들은 접속 할 때마다 IP 변동되는 유동 IP을 할 당 받는다.


이제 컴퓨터에 IP을 할 당해야 하는데 IP 중에는 IP 공인IP , 비공인 IP 등로 구분을 하는 것이 있는데 공인IP는 실제적으로 인터넷에 접속 할 수 있는 IP 주소로 이 공인 IP는ADSL접속시 할 당 받게 되며 비공인 IP 는 내부적으로 사용하는 IP이며외부 인터넷에 접속 할 수 없는 IP 주소 이며 192.168.0.1 으로 시작되며 5대의 컴퓨터를 연결 한 다고 할 때 순서대로 IP 주소를 할 당하면 되는데  ADSL 에 접속되는 컴퓨터는 2개의 IP을 할 해야 하며 


나머지 컴퓨터는 1개의 IP을 할 당하면 된다.

ADSL연결된 컴퓨터(192.168.0.1 , 192.168.0.2 )
A: 컴퓨터 (192.168.0.3)
B: 컴퓨터(192.168.0.4)
C:컴퓨터(192.168.0.5)
D:컴퓨터(192.168.0.6)


컴퓨터가 더 있을 시 이런 식으로 순서대로 IP을 할당하면 된다.


IP 할 당 예


하드웨어 설치  ADSL 연결된 컴퓨터는 IP주소를 2개을 할당해야 하기 때문에 랜카드가 2장이 설치 되어 있어야 하는데  한장은 ADSL 외장형 설치시 설치를 해 주기때문에 한장의 랜카드을 더 추가 장착 하였으며 설치된 랜카드 모델은  한국통신에서 설치한   리얼텍( RTL8029) 모델과 본인인 설치한 3com (3c900b) 모델 이다.

요즘은 ADSL 을 내장형을 많이 설치를 해주는 편인데 내장형은 리눅스 드라이버가 지원이 안 되  외장형만이 가능 하다.

리눅스 버젼은 지금 7.0 까지 버젼이 나와 있는데 버젼 6.2 에서 ADSL에 접속 할 려면 커널 컴파일 을 해야 하는데 복잡하기 때문에 리눅스 버젼 7.0 을 기준으로 설치 하겠다.

필요장비 및 소프트워어

랜카드 2장(리얼텍 8029 , 3com)
와우 리눅스 버젼 7.0 ( 미지리눅스 1.2)
ADSL 개인 전용선

(와우 리눅스는 http://www.wowlinux.com )에서 다운로드 할 수 있다.

리눅스 설치  

설치 유형

  lowres (x윈도우 해상도 1024* 768 ) 지원이 안될 시 설치 모드)

text (x윈도우가 지원이 안될 시 설치 모드)

expert (랜카드와 스카시 장비가 있을 시 선택)

linux rescue ( 리눅스 복구용 모드)

linux dd (리눅스용 드라이버디스켓이 있을시 )

리눅스 시디로 부팅을 하면 5개의 설치 유형을 선택하라고 한다.
일반적으로 형태로 설치를 하지만 랜카드를 2개 가지고 있기 때문에
설치 들어 가면서 랜카드를 인식하기 위해서는
expert 모드로 설치를 시작해야 한다.

 

  : expert  

Do you have a drive distte ?   NO 선택
(별도의 드라이비 디스켓이 있는가 )

what language   ? korea 선택

keybiard = us  선택

Installation Method ? CD-ROM 선택

Device

scsi
Network

(여기서 2개의 랜카드를 인식을 해야 한다. 랜카드 인식 순서는
ADSL 연결될 랜카드를 먼저 선택을 해야 eth0 을 할 당 받는다.)

3com 랜카드

Network  -- >  3com 3c590/3c595 vortex  

리얼텍( RTL8029)
(리얼텍은 ne 호환 모델을 선택하면 된다.)

Network --> ne 1000,2000    

 

======================================

기타 리눅스 설치는 리눅스 관련 책을  참고하시
바라면  

 

아래 ADSL 설정은 정낙수님의 글입니다.

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): <= 여기에 한통 아이디를 넣어 줍니다.




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=""


여기에서,

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=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

를 실행시키면 연결이 됩니다.



3. 매스커레이딩 사용시


랜카드가 하나 이상이고, 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로 연결되는 리눅스 머신에서는 게이트웨이를 설정할 필요가 없습니다.

여기 까지 정낙수 님의 글입니다.=============================================================

기타 팁으로 리눅스 부팅시 adsl 에 자동으로 접속하고 한다면

chkconfig 명령어를 이용하면 된다.

/sbin/chkconfig --add 35 adsl  on

이 명령어를 실행하면 부팅시 자동으로 접속이 된다. 


이문서는 자유롭게 사용이 가능합니다.

Posted by theYoungman