您好,登錄后才能下訂單哦!
今天主要說(shuō)一下關(guān)于ACL的知識(shí),初次接觸,如有不足,請(qǐng)各位大神提出寶貴意見(jiàn),謝謝。
**ACL:Access Control List 訪問(wèn)控制列表
-定義:是用來(lái)實(shí)現(xiàn)流量識(shí)別功能的。
-作用:網(wǎng)絡(luò)設(shè)備為了對(duì)特定的報(bào)文進(jìn)行操作,需要配置一系列的匹配規(guī)則,以識(shí)別 出特定的報(bào)文,然后根據(jù)預(yù)先設(shè)定的策略對(duì)該報(bào)文進(jìn)行操作。(可以簡(jiǎn)單的 理解為匹配感興趣的流量)
-實(shí)現(xiàn):
1.制定規(guī)則
2.規(guī)定動(dòng)作(允許/拒絕)
下面為大家?guī)?lái)一個(gè)小小的拓?fù)鋵?shí)際性的操作一下
設(shè)備 | IP地址及子網(wǎng) | 網(wǎng)關(guān) |
---|---|---|
PC1 | 192.168.10.1/24 | 192.168.10.254 |
PC2 | 192.168.20.2/24 | 192.168.20.254 |
PC3 | 192.168.30.3/24 | 192.168.30.254 |
PC4 | 192.168.40.4/24 | 192.168.40.254 |
R1:
<Huawei>system\進(jìn)入系統(tǒng)視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1\修改名字
[R1]vlan batch 10 20 30 40 50\創(chuàng)建vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[R1]interface Vlanif 10\進(jìn)入虛擬端口
[R1-Vlanif10]undo shutdown \開(kāi)啟虛擬端口
Info: Interface Vlanif10 is not shutdown
[R1-Vlanif10]ip address 192.168.10.254 255.255.255.0\創(chuàng)建虛擬網(wǎng)關(guān)
[R1-Vlanif10]q\退出
[R1]interface Vlanif 20\進(jìn)入虛擬端口
[R1-Vlanif20]undo shutdown \虛擬端口
Info: Interface Vlanif20 is not shutdown.
[R1-Vlanif20]ip address 192.168.20.254 255.255.255.0\創(chuàng)建虛擬網(wǎng)關(guān)
[R1-Vlanif20]q\退出
[R1]interface Vlanif 50\進(jìn)入虛擬端口
[R1-Vlanif50]undo shutdown \開(kāi)啟端口
Info: Interface Vlanif50 is not shutdown.
[R1-Vlanif50]ip address 192.168.50.1 255.255.255.0\創(chuàng)建虛擬IP
[R1-Vlanif50]q\退出
[R1]interface GigabitEthernet 0/0/1\進(jìn)入端口
[R1-GigabitEthernet0/0/1]port link-type trunk \配置鏈路模式trunk
[R1-GigabitEthernet0/0/1]port trunk allow-pass vlan all\允許所有vlan通過(guò)
[R1-GigabitEthernet0/0/1]q\退出
[R1]interface GigabitEthernet 0/0/2\進(jìn)入端口
[R1-GigabitEthernet0/0/2]port link-type trunk \配置鏈路模式trunk
[R1-GigabitEthernet0/0/2]port trunk allow-pass vlan all\允許所有vlan通過(guò)
[R1-GigabitEthernet0/0/2]q\退出
R2:
<Huawei>system-view \進(jìn)入到系統(tǒng)視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2\修改名字
[R2]vlan batch 10 20 30 40 50\創(chuàng)建vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[R2]interface Vlanif 30\進(jìn)入虛擬端口
[R2-Vlanif30]undo shutdown \開(kāi)啟虛擬端口
Info: Interface Vlanif30 is not shutdown.
[R2-Vlanif30]ip address 192.168.30.254 255.255.255.0\創(chuàng)建虛擬網(wǎng)關(guān)
[R2-Vlanif30]q\退出
[R2]interface Vlanif 40\進(jìn)入虛擬端口
[R2-Vlanif40]undo shutdown \開(kāi)啟虛擬端口
Info: Interface Vlanif40 is not shutdown.
[R2-Vlanif40]ip address 192.168.40.254 255.255.255.0\創(chuàng)建虛擬網(wǎng)關(guān)
[R2-Vlanif40]q\退出
[R2]interface Vlanif 50\進(jìn)入虛擬端口
[R2-Vlanif50]undo shutdown \開(kāi)啟虛擬端口
Info: Interface Vlanif50 is not shutdown.
[R2-Vlanif50]ip address 192.168.50.2 255.255.255.0\創(chuàng)建虛擬IP
[R2-Vlanif50]q\退出
[R2]interface GigabitEthernet 0/0/2\進(jìn)入端口
[R2-GigabitEthernet0/0/2]port link-type trunk \配置鏈路方式trunk
[R2-GigabitEthernet0/0/2]port trunk allow-pass vlan all\允許所有vlan通過(guò)
[R2-GigabitEthernet0/0/2]q\退出
[R2]interface GigabitEthernet 0/0/1\進(jìn)入端口
[R2-GigabitEthernet0/0/1]port link-type trunk \配置鏈路方式trunk
[R2-GigabitEthernet0/0/1]port trunk allow-pass vlan all\允許所有vlan通過(guò)
[R2-GigabitEthernet0/0/1]q\退出
sw1:
<Huawei>system-view\進(jìn)入系統(tǒng)視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1\修改名字
[ sw1]vlan batch 10 20 30 40 50\創(chuàng)建vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[ sw1]interface GigabitEthernet 0/0/1進(jìn)入端口
[ sw1-GigabitEthernet0/0/1]port link-type access \配置鏈路模式access
[ sw1-GigabitEthernet0/0/1]port default vlan 10\將端口加入VLAN
[ sw1-GigabitEthernet0/0/1]q\退出
[ sw1]interface GigabitEthernet 0/0/2 \進(jìn)入端口
[ sw1-GigabitEthernet0/0/2]port link-type access \配置鏈路模式access
[ sw1-GigabitEthernet0/0/2]port default vlan 20\將端口加入VLAN
[ sw1-GigabitEthernet0/0/2]q\退出
[ sw1]interface GigabitEthernet 0/0/3 \進(jìn)入端口
[ sw1-GigabitEthernet0/0/3]port link-type trunk \配置鏈路模式trunk
[ sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all\允許所有vlan通過(guò)
[ sw1-GigabitEthernet0/0/3]q\退出
[ sw1]
sw2:
<Huawei>system-view \進(jìn)入系統(tǒng)視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw2\修改名字
[sw2]vlan batch 10 20 30 40 50\創(chuàng)建vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]interface GigabitEthernet 0/0/1\進(jìn)入端口
[sw2-GigabitEthernet0/0/1]port link-type trunk \配置鏈路模式trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all\允許所有vlan通過(guò)
[sw2-GigabitEthernet0/0/1]q\退出
[sw2]interface GigabitEthernet 0/0/2 \進(jìn)入端口
[sw2-GigabitEthernet0/0/2]port link-type access \配置鏈路模式access
[sw2-GigabitEthernet0/0/2]port default vlan 30\將端口加入vlan
[sw2-GigabitEthernet0/0/2]q\退出
[sw2]interface GigabitEthernet 0/0/3\進(jìn)入端口
[sw2-GigabitEthernet0/0/3]port link-type access \配置鏈路模式access
[sw2-GigabitEthernet0/0/3]port default vlan 40\將端口加入vlan
[sw2-GigabitEthernet0/0/3]q\退出
[sw2]
R1:
[R1]rip\配置rip協(xié)議
[R1-rip-1]version 2\選擇版本2
[R1-rip-1]network 192.168.10.0\宣告網(wǎng)絡(luò)范圍
[R1-rip-1]network 192.168.20.0\宣告網(wǎng)絡(luò)范圍
[R1-rip-1]q\退出
[R1]
R2:
[R2]rip \配置rip協(xié)議
[R2-rip-1]version 2\選擇版本2
[R2-rip-1]network 192.168.30.0\宣告網(wǎng)絡(luò)范圍
[R2-rip-1]network 192.168.40.0\宣告網(wǎng)絡(luò)范圍
[R2-rip-1]q\退出
此時(shí),驗(yàn)證一下是否全網(wǎng)互通,以PC1為例:
創(chuàng)建acl可以在任何一個(gè)接口,在本次試驗(yàn)中是讓PC1和PC3不通,其他網(wǎng)絡(luò)互通,所以我選擇在R2創(chuàng)建ACL,如下:
[R2]acl name denypc1-3 \創(chuàng)建acl并命名
[R2-acl-adv-denypc1-3]rule deny ip source 192.168.10.1 0.0.0.0 destination 192.1
68.30.3 0.0.0.0\規(guī)定動(dòng)作確定源和目標(biāo)
[R2-acl-adv-denypc1-3]q\退出
[R2]interface GigabitEthernet 0/0/2\進(jìn)入端口
[R2-GigabitEthernet0/0/2]traffic-filter outbound acl name denypc1-3\調(diào)用Acl
[R2-GigabitEthernet0/0/2]q\退出
驗(yàn)證:
測(cè)試:
PC1:
測(cè)試與PC2連通性:
測(cè)試與PC4連通性:
測(cè)試與PC3連通性:
PC3:
測(cè)試與PC2連通性:
測(cè)試與PC4連通性:
測(cè)試與PC1連通性:
實(shí)驗(yàn)完成,完成實(shí)驗(yàn)?zāi)康摹?/p>
操作比較簡(jiǎn)單,我盡可能把每一步的步驟操作介紹清楚,希望大家可以理解。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。