์ƒˆ์†Œ์‹

์ธ๊ธฐ ๊ฒ€์ƒ‰์–ด

๐Ÿ’ป Linux

CentOS7 DHCP ์ž๋™ ํ• ๋‹น, ์ˆ˜๋™ ํ• ๋‹น

  • -
๋ฐ˜์‘ํ˜•
**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
๋ฐ˜์‘ํ˜•
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.