欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Firewall高級配置實(shí)例

需求簡述

1.公司內(nèi)網(wǎng)用戶需要通過網(wǎng)關(guān)服務(wù)器共享上網(wǎng)
2.互聯(lián)網(wǎng)用戶需要訪問網(wǎng)站服務(wù)器
3.只允許192.168.1 .0/24ping網(wǎng)關(guān)和服務(wù)器
4.網(wǎng)站服務(wù)器和網(wǎng)關(guān)服務(wù)器均通過SSH來遠(yuǎn)程管理,為了安全,將SSH默認(rèn)端口改為12345,只允許192.168.1.10主機(jī)SSH網(wǎng)關(guān)和服務(wù)器,允許互聯(lián)網(wǎng)SSH內(nèi)部服務(wù)器

目前創(chuàng)新互聯(lián)已為上千多家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)頁空間、網(wǎng)站托管運(yùn)營、企業(yè)網(wǎng)站設(shè)計、桂林網(wǎng)站維護(hù)等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。


拓?fù)浣Y(jié)構(gòu)圖

Firewall高級配置實(shí)例1.網(wǎng)關(guān)服務(wù)器:Centos7 -1
2.企業(yè)內(nèi)網(wǎng)測試機(jī):Centos7 -2
3.網(wǎng)站服務(wù)器:Centos7 -3
4.Internet測試機(jī):Centos7 -4


實(shí)驗(yàn)步驟

第一步:配置網(wǎng)關(guān)服務(wù)器的網(wǎng)卡及地址

1.添加網(wǎng)卡,并綁定網(wǎng)卡為VMent2僅主機(jī)模式
Firewall高級配置實(shí)例


2.配置并確認(rèn)網(wǎng)關(guān)地址

[root@192 network-scripts]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 100.1.1.10  netmask 255.255.255.0  broadcast 100.1.1.255
        inet6 fe80::839c:1220:87fc:aef  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:70:78:f5  txqueuelen 1000  (Ethernet)
        RX packets 2715  bytes 723845 (706.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 623  bytes 55679 (54.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.1  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::3d7f:4cdc:f7ec:8638  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:70:78:09  txqueuelen 1000  (Ethernet)
        RX packets 38  bytes 7923 (7.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 143  bytes 24516 (23.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.20.1  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::a6c3:1677:f71d:8e29  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:70:78:ff  txqueuelen 1000  (Ethernet)
        RX packets 38  bytes 7923 (7.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 138  bytes 23100 (22.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

3.開啟路由轉(zhuǎn)發(fā)功能

[root@192 network-scripts]# vim /etc/sysctl.conf 
......                                                                          //省略注釋內(nèi)容
net.ipv4.ip_forward = 1                                         //添加此條目
[root@192 network-scripts]# sysctl -p                   //載入sysctl配置文件
net.ipv4.ip_forward = 1


第二步:配置internal區(qū)域中內(nèi)網(wǎng)測試機(jī)的地址和網(wǎng)關(guān)

1.綁定網(wǎng)卡為VMent3僅主機(jī)模式
Firewall高級配置實(shí)例


2.配置并確認(rèn)IP地址與網(wǎng)關(guān)

[root@192 network-scripts]# ifconfig                //查看ip地址及子網(wǎng)掩碼
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.10  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::839c:1220:87fc:aef  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:90:44:7f  txqueuelen 1000  (Ethernet)
        RX packets 2647  bytes 190172 (185.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 453  bytes 51940 (50.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@192 network-scripts]# route -n            //查看路由信息
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.10.0     0.0.0.0         255.255.255.0   U     100    0        0 ens33


第三步:配置DMZ區(qū)域網(wǎng)站服務(wù)器的地址和網(wǎng)關(guān),并啟動網(wǎng)站服務(wù)

1.先在聯(lián)網(wǎng)狀態(tài)下載安裝httpd服務(wù)

[root@192 ~]# yum install httpd -y

2.綁定網(wǎng)卡為VMent3僅主機(jī)模式**
Firewall高級配置實(shí)例


3.配置并確認(rèn)IP地址與網(wǎng)關(guān)

[root@dmz ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.20.20  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::839c:1220:87fc:aef  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::791b:db71:8a12:f34  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:de:4a:b8  txqueuelen 1000  (Ethernet)
        RX packets 5353  bytes 3513622 (3.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1143  bytes 105439 (102.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@dmz ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.20.0     0.0.0.0         255.255.255.0   U     100    0        0 ens33

4.開啟網(wǎng)站服務(wù)

[root@192 ~]# vim /var/www/html/index.html
[root@192 ~]# cat /var/www/html/index.html
<h2>this is dmz web</h2>
[root@dmz html]# systemctl start httpd


第四步:在DMZ區(qū)域網(wǎng)站服務(wù)器上配置防火墻策略[root@dmz ~]# firewall-cmd --set-default-zone=dmz

success
[root@dmz ~]# firewall-cmd --add-service=http --zone=dmz --permanent                        //將防火墻的默認(rèn)區(qū)域改為dmz區(qū)域
success
[root@dmz ~]# firewall-cmd --remove-service=ssh --zone=dmz --permanent                      //添加http服務(wù)到dmz區(qū)域永久設(shè)置中
success
[root@dmz ~]# firewall-cmd --add-icmp-block=echo-request  --zone=dmz --permanent                        //禁止使用ssh進(jìn)行登錄
success
[root@dmz ~]# firewall-cmd --reload                         //重載防火墻
success


第五步:配置external區(qū)域的Internet測試機(jī)網(wǎng)卡和地址,并啟動網(wǎng)站服務(wù)

1.先在聯(lián)網(wǎng)狀態(tài)下載安裝httpd服務(wù)

[root@192 ~]# yum install httpd -y

2.綁定網(wǎng)卡為VMent1僅主機(jī)模式Firewall高級配置實(shí)例


3.配置并確認(rèn)IP地址與網(wǎng)關(guān)

[root@192 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 100.1.1.20  netmask 255.255.255.0  broadcast 100.1.1.255
        inet6 fe80::839c:1220:87fc:aef  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::791b:db71:8a12:f34  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:9e:f9:aa  txqueuelen 1000  (Ethernet)
        RX packets 6587  bytes 4090863 (3.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1266  bytes 105686 (103.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@192 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
100.1.1.0       0.0.0.0         255.255.255.0   U     100    0        0 ens33

4.開啟網(wǎng)站服務(wù),并關(guān)閉防火墻與增強(qiáng)型安全功能

[root@192 ~]# vim /var/www/html/index.html
[root@192 ~]# cat /var/www/html/index.html
<h2>this is external web</h2>
[root@192 ~]# systemctl stop firewalld.service 
[root@192 ~]# setenforce 0 


第六步:在網(wǎng)關(guān)服務(wù)器上配置防火墻策略

[root@192 ~]# firewall-cmd --set-default-zone=external              //將防火墻默認(rèn)區(qū)域改為extemal
success
[root@192 ~]# firewall-cmd --change-interface=ens36 --zone=trusted --permanent                      //將ens36網(wǎng)卡設(shè)為信任區(qū)域
The interface is under control of NetworkManager, setting zone to 'trusted'.
success
[root@192 ~]# firewall-cmd --change-interface=ens37 --zone=dmz --permanent                      //將ens37網(wǎng)卡設(shè)為dmz區(qū)域
The interface is under control of NetworkManager, setting zone to 'dmz'.
success
[root@192 ~]# firewall-cmd --zone=dmz --remove-service=ssh --permanent                      //dmz區(qū)域內(nèi)禁止使用ssh登錄
success
[root@192 ~]# firewall-cmd --zone=dmz --add-service=http --permanent                        //dmz區(qū)域內(nèi)添加http服務(wù)
success
[root@192 ~]# firewall-cmd --zone=dmz --add-icmp-block=echo-request --permanent                     //dmz區(qū)域內(nèi)阻塞icmp協(xié)議            
success
[root@192 ~]# firewall-cmd --zone=external --add-service=http --permanent                           //在外部區(qū)域添加http服務(wù)
success
[root@192 ~]# firewall-cmd --reload                     //重載防火墻
success

第七步:使用企業(yè)內(nèi)網(wǎng)測試機(jī)驗(yàn)證網(wǎng)站服務(wù)器和internel測試機(jī)提供的的網(wǎng)頁

Firewall高級配置實(shí)例

Firewall高級配置實(shí)例


第八步:在網(wǎng)關(guān)網(wǎng)關(guān)服務(wù)器上配置端口轉(zhuǎn)換

[root@192 ~]# firewall-cmd --zone=external --add-forward port=port=80:proto=tcp:toaddr=192.168.2.10 --permanent      //設(shè)定端口映射
success
[root@192 ~]# firewall-cmd --reload                     //重載防火墻 
success

第九步:使用Internet測試機(jī)訪問網(wǎng)站服務(wù)器提供的網(wǎng)頁,可以看到源IP地址被轉(zhuǎn)換(NAT)

Firewall高級配置實(shí)例

分享文章:Firewall高級配置實(shí)例
文章位置:http://chinadenli.net/article42/geophc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、手機(jī)網(wǎng)站建設(shè)響應(yīng)式網(wǎng)站、網(wǎng)站營銷、云服務(wù)器App開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)