Contents

리눅스 - Scope, DHCP Relay Agent, Reservation

   Mar 15, 2023     2 min read

Build UP.

Untitled

결과

Untitled (1)

Untitled (2)

네트워크 하나에 다중의 Scope

Untitled (3)

방법

Untitled (4)

결과

Untitled (5)

Untitled (6)

Untitled (7)

Untitled (8)

Ex. 리눅스

Untitled (9)

DHCP Reservation

Untitled (10)

Untitled (11)

DHCP Relay Agent

# mount /dev/hdc /cdrom

# cd /cdrom/CentOS
# rpm -ivh dhcp-3? (tap)
# rpm -ivh dhcp-devel(tap)

# vi /etc/sysconfig/dhcrelay
DHCPSERVER=”192.168.20.1”



Untitled (12)

# service dhcrelay restart



결과

Untitled (13)

Untitled (14)

Untitled (15)

CentOs 7 cdrom으로 yum 설치 구성

# df (-h)
# umount “/run/media/root/CentOS 7 x86)64” ← 안 해도 상관 없음.

# mkdir /cdrom
# mount /dev/sr0 /cdrom

# cd /etc/yum.repos.d
# mv *.repo /tmp/

# vi /etc/yum.repos.d/local.repo
[LocalRepo]
baseurl=file:///cdrom 
gpgcheck=0

# yum clean all

# vi /etc/fstab
/dev/sr0 /cdrom iso 9660 defaults 1 2



DHCP Server

# mount /dev/sr0 /cdrom

# yum -y install dhcp*

# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example t 2./etc/dhcp/dhcpd.conf

# vi/etc/dhcp/dhcpd.conf
-필수-
default-lease-time 6000;
max-lease-time 72000;
subnet 172.19.0.0 netmask 255.255.0.0 {
range 172.19.0.1 172.19.10.253;
option routers 172.19.0.254;
option broadcast-address 172.19.255.255.;
option subnet-mask 255.255.0.0;
option domain-name-servers 8.8.8.8;
}
-나머진 전부 주석 처리 하기-

# systemctl restart dhcpd
# systemctl enable dhcpd

# firewall-cmd —zone=public —add-service=dhcp —permanent
or
# service firewalld stop

# vi /var/lib/dhcpd/dhcpd.lease



DHCP Client

# ifdown
# ifup
# ifconfig
“IP주소 할당 확인”



Ex.

Untitled (16)

결과

Untitled (17)

Untitled (18)

ping이 간다 ? <- 고치기