ACL擴展訪問控制列表

實驗環境

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

實驗目的

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

實驗步驟

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

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

2、安裝完服務後,進入網卡配置,配置一個靜態IP,然後重新啓動網卡

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

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

[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裏寫入內容

6、進入到RI路由器中配置,分別給接口配置ip地址
在這裏插入圖片描述
在這裏插入圖片描述
7、配置完之後查看主機之間的互通性
在這裏插入圖片描述
在這裏插入圖片描述
此時Win10-1和Win10-2都可以訪問服務端的ftp和web服務
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
8、進入都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服務

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章