목요일, 12월 14, 2006

linux network settting - route

http://kelp.or.kr/korweblog/stories.php?story=01/09/29/1007612


[ 네트워크 설정(두개의 랜카드 잡기) ]

1. IRQ, IO 번호 확인하기
$ cat /proc/pci
$ cat /proc/interrupts
$ cat /proc/ioports
$ dmesg

2. 부팅시 커널차원에서 인식 시키기
# Lan종류 + auto IRQ + auto IO + Lancard Device 번호의 순서로
$ vi /etc/lilo.conf
append="ether=0,0,eth0 ether=0,0,eth1" # PnP 인식
# append="ether=11,0x6100,eth0 ether=5,0x300,eth1" # 특정 인식

3. 일종의 드라이버인 모듈을 올리기
$ ls /lib/modules/kernel-version/net
$ modprobe ne.o io=0x300 irq=5
$ lsmod
$ rmmod
$ vi /etc/conf.modules
alias eth0 rtl8139 # PCI LANCard인 경우
alias eth1 ne # ISA LANCard인 경우
options ne io=0x300 irq=5
$ control-panel
Kernel Daemon Configuration -> Add -> Module Types eth -> OK ->
Which module type? eth1 -> Which module? ne -> OK ->
io=0x300 -> irq=5 -> Done

4. CMOS 차원에서의 IRQ 설정
# CMOS에서 네트워크의 PNP 기능을 없애서 내정 IRQ에 따른 출동을 피한다
[PNP/PCI Configuration]
PNP OS Installed : NO

5. 랜카드 차원에서의 IRQ 설정
# 물리적인 변경
LANCard Jumper move 10 -> 5
# 프로그램을 이용한 변경
Intel Ether Express Pro/10 PNP ISA e10disk.exe sofset2.exe
RealTek 8019 ISA PNP Ethernet(ne2000) rset8019.exe
# Setup
Plug and Play : Disable(or Juper less)
IO and IRQ setting

6. 모듈이 잡혔나 확인하기
$ uname -a # 커널버전 보기
$ ls /lib/modules/2.2.7/net
ne.o rt8139.o
$ /sbin/lsmod # 확실히 이부분이 올라와 있어야 한다
ne, rt8139 Module
$ modprobe ne io=0x300 irq=5 # 모듈을 로드 시키는 명령

7. 네트워크 등록정보 입력
# ip 설정
$ ifconfig # 기존 정보 보기
$ ifconfig eth0 192.168.10.5
$ ifconfig eth0 192.168.10.5 netmask 255.255.255.0 up # ip를 설정하는 명령
$ ifconfig eth0 down
# 라우팅 테이블 설정
$ route # 기존 정보 보기
$ netstat -nr # 기존 정보 보기
$ route add -net 192.168.10.0 netmask 255.255.255.0 dev eth0 # 추가 명령
$ route del default gw 192.168.255.255 eth0 # 삭제 명령
$ route add default gw 203.239.44.50 eth0
# 비주얼 제어판을 통한 설정
$ netcfg # 혹은 "$ linuxconf"
Default Gateway-203.239.44.50
Default Gateway Device-eth0
$ ifdown eth0; ifup eth0

8. 텍스트를 통한 Route, Gateway 설정
$ vi /etc/sysconfig/static-routes
# 각기 다른 게이트웨이를 쓸 경우 or skip
eth0 net 192.168.10.0 netmask 255.255.255.0 gw 192.168.10.1
eth1 net 192.168.11.0 netmask 255.255.255.0 gw 192.168.11.1
eth1:0 net 192.168.12.0 netmask 255.255.255.0 gw 192.168.12.1
# eth1:0 IP-Alias를 적용한 예
$ vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
IPADDR="192.168.100.1"
NETMASK="255.255.255.0"
NETWORK="192.168.100.0"
BROADCAST="192.168.100.255"
ONBOOT="yes"
BOOTPROTO="none"
GATEWAY="192.168.11.1" # 여기다 직접 게이트웨이를 쓸수있다.
GATEWAYDEV="eth1"
$ netcfg
$ ifdown eth1; ifup eth1
$ ifconfig

9. 네트워크를 설정하는데 쓰이는 파일들
# Basic file: hosts, resolv.conf, network, ifcfg-eth0
/etc/HOSTNAME
/etc/host.conf
/etc/hosts
/etc/resolve.conf
/etc/nsswitch.conf
/etc/conf.modules
/etc/sysconfig/network
/etc/sysconfig/static-routes
/etc/sysconfig/network-scripts/ifcfg-eth0

10. 네트워크 테스트 명령들
$ ping; traceroute; nslookup

댓글 없음: