溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

建立擴(kuò)展ACL實(shí)戰(zhàn)

發(fā)布時(shí)間:2020-07-11 03:11:03 來源:網(wǎng)絡(luò) 閱讀:171 作者:qq5d47f509174fe 欄目:系統(tǒng)運(yùn)維

建立擴(kuò)展ACL實(shí)戰(zhàn)

本次實(shí)驗(yàn)拓?fù)鋱D如下:

建立擴(kuò)展ACL實(shí)戰(zhàn)

實(shí)驗(yàn)?zāi)康模?/h4>

完成在R1路由上擴(kuò)展ACL的建立,實(shí)現(xiàn)實(shí)驗(yàn)要求:

允許PC1訪問Linux的web服務(wù);

允許PC2訪問Linux的ftp服務(wù);

禁止PC1、PC2訪問Linux的其它服務(wù);

允許PC1聯(lián)通PC2

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

1、完成兩臺(tái)PC機(jī)靜態(tài)的設(shè)置與網(wǎng)卡的綁定

建立擴(kuò)展ACL實(shí)戰(zhàn)建立擴(kuò)展ACL實(shí)戰(zhàn)
建立擴(kuò)展ACL實(shí)戰(zhàn)建立擴(kuò)展ACL實(shí)戰(zhàn)

2、完成Linux服務(wù)器相關(guān)服務(wù)的安裝與啟動(dòng)

[root@localhost ~]# yum install vsftpd -y      //安裝ftp服務(wù)
[root@localhost ~]# yum install httpd -y       //安裝http服務(wù)
[root@localhost ~]# systemctl stop firewalld.service    //關(guān)閉防火墻
[root@localhost ~]# setenforce 0               //關(guān)閉增強(qiáng)性安全功能
[root@localhost ~]# systemctl start httpd      //啟動(dòng)服務(wù)
[root@localhost ~]# systemctl start vsftpd
[root@localhost ~]# netstat -ntap | egrep '(21|80)'     //檢查服務(wù)啟動(dòng)狀況(80端口為http,21端口為ftp)
tcp6       0      0 :::80                   :::*                    LISTEN      6399/httpd          
tcp6       0      0 :::21                   :::*                    LISTEN      6435/vsftpd         

3、Linux設(shè)置靜態(tài)IP并綁定網(wǎng)卡

建立擴(kuò)展ACL實(shí)戰(zhàn)建立擴(kuò)展ACL實(shí)戰(zhàn)

4、R1路由的設(shè)置

R1#conf t 
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f 0/0
R1(config-if)#ip add 192.168.90.1 255.255.255.0
R1(config-if)#no shut 
R1(config-if)#int f 0/1
R1(config-if)#ip add 192.168.80.1 255.255.255.0
R1(config-if)#no shut 
R1(config-if)#int f 1/0
R1(config-if)#ip add 192.168.100.1 255.255.255.0 
R1(config-if)#no shut 
R1(config-if)#ex
R1(config)#do show ip route                 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.90.0/24 is directly connected, FastEthernet0/0
C    192.168.80.0/24 is directly connected, FastEthernet0/1
C    192.168.100.0/24 is directly connected, FastEthernet1/0
R1(config)#
注意:此時(shí),R1路由上并沒有進(jìn)行ACL的設(shè)置,為滿足實(shí)驗(yàn)要求,接下來進(jìn)行擴(kuò)展ACL的設(shè)置。
R1(config)#$t tcp 192.168.80.20 0.0.0.255 192.168.100.100 0.0.0.255 eq 80           
R1(config)#$ 100 permit tcp host 192.168.90.10 host 192.168.100.100 eq 21      
R1(config)#$ 100 permit ip host 192.168.80.20 192.168.90.0 0.0.0.255         
R1(config)#do show access-list
Extended IP access list 100
    10 permit tcp 192.168.80.0 0.0.0.255 192.168.100.0 0.0.0.255 eq www
    20 permit tcp host 192.168.90.10 host 192.168.100.100 eq ftp
    30 permit ip host 192.168.80.20 192.168.90.0 0.0.0.255
R1(config)#int f 0/1        
R1(config-if)#ip access-group 100 in
R1(config-if)#int f0/0
R1(config-if)#ip access-group 100 in
R1(config-if)#ex 
R1(config)#       

實(shí)驗(yàn)結(jié)果

以上設(shè)置均已完成的情況下,進(jìn)行實(shí)驗(yàn)驗(yàn)證,應(yīng)該為以下情況:

建立擴(kuò)展ACL實(shí)戰(zhàn)建立擴(kuò)展ACL實(shí)戰(zhàn)建立擴(kuò)展ACL實(shí)戰(zhàn)

以上,就是完整的擴(kuò)展ACL的實(shí)戰(zhàn)教學(xué)。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI