一、拓撲圖中一臺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