**DHCP ์๋ ํ ๋น**
**Centos7_Third : First์์ DHCP IP ํ ๋น ๋ฐ์๊ฒ**
๋คํธ์ํฌ ์ค์ - dhcp ์๋น์ค ๋๊ธฐ
systemctl restart network # ์๋จ , ๋ฌดํ๋ก๋ฉ
ifconfig # ๋คํธ์ํฌ ํ ๋น ๋ชป๋ฐ์๊ฒ ํ์ธ
**Centos7_First DHCP์๋ฒ**
yum -y install dhcp
ps -ef | grep dnsmasq # dhcp์ ์ถฉ๋๋ผ์ ์คํ ์๋๋ ๊ฒฝ์ฐ ๋ฐฉ์ง
kill -9 1774
kill -9 1777 # dnsmasq ๊ฐ์ ์ข
๋ฃ
vim /etc/dhcp/dhcp.conf # dhcp ์ค์ ํ์ผ
ddns-update-style interim ;
subnet 192.168.111.0 netmask 255.255.255.0
option routers 192.168.111.2 ;
option subnet-mask 255.255.255.0 ;
range dynamic-bootp 192.168.111.30 192.168.111.50 ;
option domain-name-servers 192.168.111.2 ;
default-lease-time 10000 ;
max-lease-time 20000;
}
systemctl restart dhcpd
cat /var/lib/dhcpd/dhcpd.leases # ํ์ฌ DHCP ์ค์ ํ์ธ
lease 192.168.111.30 { #192.168.111.30์ ip์ฃผ์๋ฅผ ๊ฐ์ ธ๊ฐ๋ค
starts 4 2022/04/21 02:38:41;
ends 4 2022/04/21 05:25:21;
cltt 4 2022/04/21 02:38:41;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:0c:29:6b:e1:f1; # ์ด mac์ฃผ์๋ฅผ ๊ฐ์ง ์ฌ๋์ด
**Centos7_Third ์์ ifconfig๋ก ip์ฃผ์ ํ์ธ**
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.111.30 netmask 255.255.255.0 broadcast 192.168.111.255
inet6 fe80::9a06:5ccf:9eee:ce4c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:6b:e1:f1 txqueuelen 1000 (Ethernet)
RX packets 86442 bytes 117969886 (112.5 MiB)
**DHCP ์๋ ํ ๋น**
vim /etc/dhcp/dhcp.conf # dhcp ์ค์ ํ์ผ
host client1 {
option host-name "client1";
hardware ethernet 00:0c:29:6b:e1:f1 ; # Third mac ์ฃผ์์๊ฒ
fixed-address 192.168.111.77 ; # ์ด ip ์ฃผ์๋ฅผ ์๋์ผ๋ก ํ ๋น ํ๊ฒ ๋ค
}
systemctl restart network