리눅스 초급/DHCP

[DHCP](2) DHCP 기본설정

알 수 없는 사용자 2016. 5. 3. 00:41

1. yum으로 설치

[root@localhost ~]# yum -y install dhcp*


[root@localhost ~]# rpm -qa | grep dhcp*

dhcp-devel-4.1.1-49.P1.el6.centos.x86_64

dhcp-common-4.1.1-49.P1.el6.centos.x86_64

dhclient-4.1.1-49.P1.el6.centos.x86_64

dhcp-4.1.1-49.P1.el6.centos.x86_64


2. 처음에 /etc/dhcp/dhcpd.conf 에 내용이 없기 때문에 sample 파일을 복사해온다.

[root@localhost ~]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf


3. vi /etc/dhcp/dhcpd.conf 편집

#

# DHCP Server Configuration file.

#   see /usr/share/doc/dhcp*/dhcpd.conf.sample

#   see 'man 5 dhcpd.conf'

#

default-lease-time 600; // 기본 연결 시간입니다.

max-lease-time 7200; // 최대 연결 시간입니다.

option domain-name-servers 168.126.63.1; // 도메인 네임 서버의 IP 주소

subnet 220.116.179.0 netmask 255.255.255.0 { // IP 주소 대역과 서브넷마스크 

        option routers 220.116.179.254; // Gateway 주소

        option broadcast-address 220.116.179.255; // Broad cast 주소

        range 220.116.179.100 220.116.179.250; // 동적으로 할당할 IP 주소 

}