ACL擴展訪問控制列表

實驗環境

一、拓撲圖中一臺Linux服務器
二、兩臺PC機作客戶機(Win10,Win10-2)html

實驗目的

一、只容許Win10-1訪問Linux的Web服務,禁止訪問其餘服務
二、Win10-1訪問Win10-2主機
在這裏插入圖片描述web

實驗步驟

一、在Linux系統上安裝ftp服務和http服務vim

[root@localhost ~]# yum install httpd -y
[root@localhost ~]# yum install vsftpd -y

二、安裝完服務後,進入網卡配置,配置一個靜態IP,而後從新啓動網卡安全

[root@localhost html]# vim /etc/sysconfig/network-scripts/ifcfg-ens33    //配置網卡
[root@localhost ~]# service network restart  //從新啓動網卡

在這裏插入圖片描述
三、接下來綁定網卡,Linux綁定VMnet2網卡,Win10-1綁定VMnet1,Win10-2綁定VMnet3
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
四、打開兩臺Win10,分別配置固定IP
在這裏插入圖片描述
在這裏插入圖片描述
關閉Win10的防火牆,以避免對實驗形成影響
五、爲了實驗須要在/html和/ftp裏建立兩個文件bash

[root@localhost ~]# cd /var/www/html/   
[root@localhost html]# ls
[root@localhost html]# vim index.html

在這裏插入圖片描述

[root@localhost html]# systemctl start httpd   //啓動http服務
[root@localhost html]# systemctl stop firewalld.service  //關閉防火牆 
[root@localhost html]# setenforce 0   //關閉加強性安全功能
[root@localhost html]# systemctl start vsftpd   //啓動ftp服務
[root@localhost html]# echo "this is ftp" > ftp.txt   //在ftp裏寫入內容

六、進入到RI路由器中配置,分別給接口配置ip地址
在這裏插入圖片描述
在這裏插入圖片描述
七、配置完以後查看主機之間的互通性
在這裏插入圖片描述
在這裏插入圖片描述
此時Win10-1和Win10-2均可以訪問服務端的ftp和web服務
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
八、進入都R1裏進行配置,達到實驗目的服務器

access-list 100 permit tcp host 192.168.1.2 host 192.168.100.100 eq www
// 容許192.168.1.10的主機訪問地址爲192.168.100.100服務器的web服務(web屬於tcp協議)
access-list 100 deny ip host 192.168.1.2 host 192.168.100.100
// 拒絕192.168.1.10的主機訪問地址爲192.168.100.100服務器的任何服務(ip表示任何服務協議)
access-list 100 permit ip host 192.168.1.2 192.168.2.0 0.0.0.255
// 容許192.168.1.10的主機訪問2.0網段的主機
int f0/0  // 進入f0/0接口
ip access-group 100 in // acl應用於f0/0接口上

實驗結果

Win10-1依舊能夠訪問Web服務
在這裏插入圖片描述
也可ping通Win10-2主機,可是沒法訪問ftp服務tcp

在這裏插入圖片描述
在這裏插入圖片描述

相關文章
相關標籤/搜索