dhcp¼¹ö ±¸Ãà
https://www.ehostidc.co.kr/ (512)https://www.ehostidc.co.kr/hosting/domestic.php (493)
1) dhcp설치 |
[root@localhost ~]# yum –y install dhcp* |
2-1) dhcp설정 |
[root@localhost ~]# vi /etc/dhcp/dhcpd.conf # # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample #샘플 config 참조 # see 'man 5 dhcpd.conf' #man 페이지 참조 |
2-2) dhcp설정 |
root@localhost:[~]: cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf #샘플 config복사 root@localhost:[~]: vi /etc/dhcp/dhcpd.conf # dhcpd.conf # # Sample configuration file for ISC dhcpd # default-lease-time 6000; #IP기본 사용 시간 max-lease-time 72000; #IP최대 사용 시간 subnet 192.168.126.0 netmask 255.255.255.0 { #dhcp서버 IP대역 range 192.168.126.201 192.168.126.253; #client IP할당 대역 option routers 192.168.126.2; #게이트웨이 option subnet-mask 255.255.255.0; #서브넷마스크 option domain-name-servers 8.8.8.8; #dns서버 ##샘플 config에서 필요한 설정만 수정해도 되지만 위와 같이 전체 삭제 및 필요설정 추가 |
3) dhcp서비스 시작 및 확인 |
root@localhost:[~]: systemctl start dhcpd root@localhost:[~]: netstat -lnp | grep dhcp |
4) client IP설정 |
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 [root@localhost ~]# service network restart |
5) client IP 및 mac address 확인 |
[root@localhost ~]# service network restart [root@localhost ~]# ip a |
6) dhcp서버 IP할당 내역 확인 |
root@localhost:[~]: cat /var/lib/dhcpd/dhcpd.leases |
7) 실습환경 |
dhcp서버: CentOS7 dhcp client: CentOS6.5 네트워크 구성: NAT (서버/client) |