default-lease [1일] : 해당 시간이 되면 PC가 동작중인지 여부를 확인한다.
max-lease [1일 1시간] :

CentOS8 : DNS서버 & 웹서버 → VMnet10 (211.183.3.X)
CentOS7 : 일반PC → VMnet10 (DHCP를 이용하여 211.183.3.201 ~ 239사이 할당 받도록)
DNS : 211.183.3.88
http://www.test.pri
CentOS8 : DNS 서버(캐시네임서버, 마스터네임서버)
관리하는 도메인 주소 : test.pri
웹서버 : www.test.pri
DHCP 서버로 동작
작업 순서
[CentOS8]
vi /etc/ssh/sshd_config
password어쩌구 변경
systemctl restart sshd
vi /etc/default/grub bioses?하지않겠다
network-scripts ifcfg-eth0으로 변경
vi ifcfg~들어가서 Proxymethod지우고 등등 booteth0으로바꾸고 device도 eth0 ipaddr 88로 dns1을127001 dns2를 8888
grub2-mkconfig -o /boot/grub2/grub.cfg reboot
ifconfig | more
ping www.google.com 정상적연결해야함
캐시서버
dnf -y install bind bind-chroot
any any dnssecvalidation no
systemctl restart named
centos7
211.183.3.?? / 3.2
211.183.3.88을 DNS로 해서 인터넷 나갈수있는지만 쳌
nslookup server
nslookup www.google.com로 확인
vi /etc/default/grub
6행 가장 뒤에 net.ifnames=0 biosdevname=0 추가

cd /etc/sysconfig/network-scripts
mv ifcfg-ens160 ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0


systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
dnf -y install httpd
echo "hello" > /var/www/html/index.html
systemctl enable httpd --now
systemctl status httpd <-- 동작상태 확인
dnf -y install bind bind-chroot
vi /etc/named.conf
listen-on port 53 { any; }; # 127.0.0.1 -> any 로 수정
listen-on-v6 port 53 { none; }; # none 으로 수정
allow-query { any; }; # any 로 수정
dnssec-validation no; # yes 를 no 로 수정
systemctl restart named
systemctl enable named
systemctl status named
vi /etc/named.conf

named-checkconf
cd /var/named/
ls
touch test.pri.db
vi test.pri.db

systemctl restart named
[root@server named]# named-checkzone test.pri test.pri.db <--- 구성파일 점검
zone test.pri/IN: loaded serial 2
OK <--- 문제없음 확인!!!
[확인]
echo "HELLO" > /var/www/html/index.html
systemctl restart httpd
curl www.test.pri
[centos7]

[centos7]
rpm -qa dhcp-client # DHCP 클라이언트 패키지 확인
vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp로 변경
nmcli connection down eth0
nmcli connection up eth0
reboot
[centos8]
dnf -y install dhcp-server
vi /etc/dhcp/dhcpd.conf

ls -l /var/lib/dhcpd/dhcpd.leases
systemctl restart dhcpd
systemctl enable dhcpd
systemctl status dhcpd
[centos7]
DHCP auto로 변경
su -c 'systemctl restart NetworkManager'
설정한 201~239 사이 할당 받은 것 확인

[centos7]
cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 211.183.3.88
[centos7]


echo "1" > /proc/sys/net/ipv4/ip_forward
[root@srv7 ~]# cat /proc/sys/net/ipv4/ip_forward
1
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1 추가
systemctl status firewalld
systemctl start firewalld
[root@srv7 ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
방화벽이 활성화 된 상태
과거의 방화벽은 인터페이스별로 정책을 설정하였다.
zone을 이용할 수 있다.
[root@srv7 ~]# firewall-cmd --get-default-zone
public
[root@srv7 ~]# firewall-cmd --zone=work --add-interface=eth1
success
[root@srv7 ~]# firewall-cmd --zone=work --add-service=ssh
Warning: ALREADY_ENABLED: 'ssh' already in 'work'
success
# 특정 port도 설정 가능
[root@srv7 ~]# firewall-cmd --zone=work --add-port=8888/tcp
success
[root@srv7 ~]# firewall-cmd --zone=work --list-all
work (active)
target: default
icmp-block-inversion: no
interfaces: eth1
sources:
services: dhcpv6-client ssh
ports: 8888/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@srv7 ~]# firewall-cmd --permanent --add-port=80/tcp
success
[root@srv7 ~]# firewall-cmd --reload
success
[root@srv7 ~]# cat /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<port protocol="tcp"
[root@srv7 firewalld]# cd /etc/firewalld/
[root@srv7 firewalld]# cd zones
[root@srv7 zones]# ls
public.xml public.xml.old
[root@srv7 zones]# cat public.xml > dbzone.xml
[root@srv7 zones]# vi dbzone.xml

You have new mail in /var/spool/mail/root
[root@srv7 zones]# firewall-cmd --reload
success
[root@srv7 zones]# firewall-cmd --get-zones
block dbzone dmz drop external home internal public trusted work
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-port=3306/tcp
firewall-cmd --reload
add-service=ssh 이런식으로 service=mariadbd 이런식으로 만들어 쓰고싶다면 xml 파일을 만들어 정의 할 수 있음
[root@srv7 zones]# cd /etc/firewalld/services/
[root@srv7 services]# ls
[root@srv7 services]# cat /usr/lib/firewalld/
helpers/ icmptypes/ ipsets/ services/ zones/
[root@srv7 services]# cp /usr/lib/firewalld/services/ssh.xml ./mariadb.xml
You have new mail in /var/spool/mail/root
[root@srv7 services]# ls
mariadb.xml

[root@srv7 services]# firewall-cmd --reload
success
[root@srv7 services]# firewall-cmd --permanent --add-service=mariadb
success