cisco思科交換機擴展ACL實驗
交換機 B 的配置如下:
PC1-PC4 的網路設置為:
驗證:
1、配置 ACL 之前,PC1 和 PC2 都可以 telnet 交換機 A。
2、配置 ACL 後,PC1 可以 telnet 交換機 A,而 PC2 不可以 telnet 交換機 A。 若實驗結果和理論相符,則本實驗完成。
六、 實驗步驟
第一步:交換機全部恢復出廠設置,在交換機中創建vlan100 和vlan200,並添加埠。
交換機 B:
switchB(Config)#vlan 100
switchB(Config-Vlan100)#
switchB(Config-Vlan100)#switchport interface ethernet 0/0/1-8
switchB(Config-Vlan100)#exit
switchB(Config)#vlan 200
switchB(Config-Vlan200)#switchport interface ethernet 0/0/9-16
switchB(Config-Vlan200)#exit
switchB(Config)#
第二步:設置交換機trunk 埠
交換機B:
switchB(Config)#interface ethernet 0/0/24
switchB(Config-Ethernet0/0/24)#switchport mode trunk
Set the port Ethernet0/0/24 mode TRUNK successfully
switchB(Config-Ethernet0/0/24)#switchport trunk allowed vlan all
set the port Ethernet0/0/24 allowed vlan successfully
switchB(Config-Ethernet0/0/24)#exit
switchB(Config)#
交換機A:
switchA(Config)#vlan 100
switchA(Config-Vlan100)#exit
switchA(Config)#vlan 200
switchA(Config-Vlan200)#exit
switchA(Config)#interface ethernet 1/1
switchA(Config-Ethernet1/1)#switchport mode trunk
Set the port Ethernet1/1 mode TRUNK successfully
switchA(Config-Ethernet1/1)#switchport trunk allowed vlan all
set the port Ethernet1/1 allowed vlan successfully
switchA(Config-Ethernet1/1)#exit
switchA(Config)#
第三步:交換機A 添加vlan 地址。
switchA(Config)#int v 100
switchA(Config-If-Vlan100)#ip ad 192.168.100.1 255.255.255.0
switchA(Config-If-Vlan100)#no shut
switchA(Config-If-Vlan100)#exit
switchA(Config)#int v 200
switchA(Config-If-Vlan200)#ip address 192.168.200.1 255.255.255.0
switchA(Config-If-Vlan200)#no shut
switchA(Config-If-Vlan200)#exit
第四步:配置交換機A 的telnet 信息
switchA(Config)#telnet-user admin password 0 admin
switchA(Config)#
第四步:不配置ACL 驗證實驗。
驗證 PC1 和PC2 之間是否可以telnet 192.168.100.1 或者192.168.200.1
第五步:配置ACL
switchA(Config)#ip access-list extended test2
switchA(Config-Ext-Nacl-test2)#deny tcp 192.168.200.0 0.0.0.255
any-destination d-port 23 !拒絕192.168.200.0/24 telnet 數據
switchA(Config-Ext-Nacl-test2)#
switchA(Config)#firewall enable ! 配置訪問控制列表功能開啟
switchA(Config)#firewall default permit !默認動作為全部允許通過
switchA(Config)#interface ethernet 1/1 !綁定ACL 到各埠
switchA(Config-Ethernet1/1)#ip access-group test2 in
第六步:驗證實驗。
PC1:
login:admin
password:*****
switchA>en
switchA#
switchA#exit
switchA>exit
失去了跟主機的連接。
PC2
CDocuments and SettingsAdministrator>telnet 192.168.200.1
正在連接到192.168.200.1...不能打開到主機的連接, 在埠 23: 連接失敗
CDocuments and SettingsAdministrator>
七、 注意事項和排錯
1、 埠可以成功綁定的 ACL 數目取決於已綁定的 ACL 的內容以及硬體資源限制,如 果因為硬體資源有限無法配置會提示用戶相關信息。
2、 可以配置 ACL 拒絕某些 ICMP 報文通過以防止「衝擊波」等病毒攻擊。
八、 配置序列
switchA#show run
Current configuration:
!
hostname switchA
!
telnet-user admin password 0 admin
!
!
ip access-list extended test2
deny tcp 192.168.200.0 0.0.0.255 0.0.0.0 255.255.255.255 d-port 23
!
firewall enable
!
!
Vlan 1
vlan 1
!
Vlan 100
vlan 100
!
Vlan 200
vlan 200
!
Interface Ethernet1/1
ip access-group test2 in
switchport mode trunk
!
Interface Ethernet1/2
!
……
Interface Ethernet1/28
!
interface Vlan100
interface vlan 100
ip address 192.168.100.1 255.255.255.0
!
interface Vlan200
interface vlan 200
ip address 192.168.200.1 255.255.255.0
!
Interface Ethernet0
!
switchA#
九、 共同思考
1、 第五步,綁定 access-group 到埠的時候,in 和 out 參數各有什麼含義?
2、 能否通過 ACL 實現 A 可以訪問 B,但是 B 不可以訪問 A?
※手機5G網路與4G對比,到底網路會差別多少
※2015年計算機四級《網路工程師》考前單選題
TAG:網路工程師 |