(第二臺是防火墻 第三臺是阿帕奇)
第一臺
配ip 192.168.1.10
網關 192.168.1.1
第三臺
IP 192.168.2.10
網關 192.168.2.1
第四臺
100.1.1.100
第二臺
cd /etc/sysconfig/network-scripts/
cp ifcfg -ens33 ifconfigens37
cp ifcfg -ens33 ifconfigens38
33
100.1.1.10
255.0.0.0
37
192.168.1.1
255.255.255.0
38
192.168.2.1
255.255.255.0
第二臺
vim /etc/sysctl.conf
net.ipv4.ip_forward =1
第三臺
mount /dev/
yum -y install httpd mod_ssl
systemctl enable httpd
systemctl restart httpd
vim /var/www/html/index.html
hhahhahahahha
firefox 訪問本地 第二臺 vim /etc/ssh/sshd_config port 12345 systemctl restart sshd systemctl status firewalld systemctl enable firewalldfirewall-cmd --set-default-zone=dmz
firewall-cmd --zone=dmz --add-service=https --permanent
firewall-cmd --zone=dmz --add-port=12345/tcp --permanent
firewall-cmd --zone=dmz --add-icmp-block=echo-request --permanent
firewall-cmd --zone=dmz --remove-service=ssh --permanent
重新加載防火墻,激活配置
firewall-cmd --reload
查看策略串列
firewall-cmd --list-all --zone=dmz
firewall-cmd --state
設定默認區域
firewall-cmd --set-default-zone=external
firewall-cmd --change-interface=ens37 --zone=trusted
firewall-cmd --change-interface=ens38 --zone=dmz
第一臺
firefox https://192.168.2.10
第四臺
firefox https://192.168.2.10
第三臺
vim /etc/ssh/sshd_config
修改:
port 12345
systemctl restart sshd
第二臺
firewall-cmd --zone=external --add-port=12345/tcp --permanent
firewall-cmd --zone=external --add-icmp-block=echo-request --permanent
firewall-cmd --reload
第四臺
ssh -p 12345 100.1.1.10
第一臺
ssh -p 12345 192.168.2.10
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/242317.html
標籤:其他
上一篇:linux常用命令大全(五)
