Korea FreeBSD Users Group
Korea FreeBSD Users Group News, Internal, Projects, Home
Software, Support, Documentation

(Answer) (Category) FreeBSD 비공식 한국어 FAQ : (Category) 네트워크 :
FreeBSD에서 아이피 주소나 디폴트 라우터의 수정은 어떻게 합니까?
대략 2가지 방법이 있습니다.
첫번째로 /etc/rc.conf파일을 수정해 주는 것입니다. 다음은 rc.conf파일의 예입니다.

ifconfig_fxp0="inet 155.230.12.92  netmask 255.255.252.0"
hostname="tenet2.knu.ac.kr"
defaultrouter="155.230.12.1"

위에 보이는 부분을 적당히 변경해주고 리부팅을 시켜주면 됩니다.

리부팅을 못할 경우는 다음과 같은 방법이 가능합니다.
먼저 "ifconfig -a"해 보시면 자신의 network 카드 이름과 아이피 주소 등을 알 수 있습니다. 결과는 다음과 비슷할 것입니다.
tenet2@~> ifconfig -a
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 155.230.12.92 netmask 0xfffffc00 broadcast 155.230.15.255
        ether 00:d0:b7:09:4a:f9 
        media: autoselect (10baseT/UTP) status: active
        supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP
tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000

아이피 주소의 변경은 위와 같은 환경에서 다음과 같이 합니다.
ifconfig fxp0 down
ifconfig fxp0 up 155.230.12.100 netmask 0xfffffc00

아이피 주소가 변경되어 디폴트 라우터의 주소또한 변경되어야 하는 경우는 route명령을 사용합니다. 우선 "netstat -rn" 으로 라우팅 테이블을 확인해 봅니다.
tenet2@~> netstat -rn
Routing tables
Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            155.230.12.1       UGSc        5        9     fxp0
127.0.0.1          127.0.0.1          UH          0       66      lo0
155.230.12/22      link#1             UC          0        0     fxp0
155.230.12.1       40:bb:82:10:1:21   UHLW        5        0     fxp0   1171
155.230.12.4       8:0:20:a6:7e:a7    UHLW        0        8     fxp0   1182
--생략--

이제 디폴트 라우터 변경을 위해서는 다음과 같이
route delete default
route add default 155.230.16.1

자 다시 "netstat -rn"으로 라우팅 테이블이 변경되었나 확인해 보세요.

참고로 DNS의 설정은 /etc/resolv.conf파일에서 수정합니다. 다음은 resolv.conf의 예입니다.

domain  knu.ac.kr
nameserver      155.230.12.4
guru0109
[Append to This Answer]
Previous: (Answer) FreeBSD에서 ADSL을 이용할 수 있습니까?
Next: (Answer) FreeBSD에서 A+P+M 을 설치하려면?
This document is: http://www.kr.freebsd.org/cgi-bin/fom.cgi?file=51
[Search] [Appearance]
This is a Faq-O-Matic 2.719.

Copyright © 1998-2003 Korea FreeBSD Users Group.
All rights reserved. webmaster at kr.FreeBSD.org
Powered by FreeBSD