PDA

View Full Version : lab cấu hình Port security và storm control



admin
12-11-2004, 07:48 PM
PORT-SECURITY

I. Sơ đồ mạng:


Dùng một PC có tên là PC1 cắm vào port f0/5 của Catalyst.
Yêu cầu đề bài: Cấu hình tính năng port security trên port f0/5 của switch sao cho port f0/5 chỉ dành cho MAC-address của PC1. Nếu một máy PC2 cắm vào port f0/5 thì port này sẽ bị SHUTDOWN. Sau khi máy PC1 cắm lại vào port f0/5, port này sẽ tự động khôi phục lại sau 60s.

II. Các bước thực hiện:

1. Thực hiện cấu hình hostname của switch, đặt tên switch là AL1
2. Cấu hình interface vlan1, gán địa chỉ IP cho interface vlan 1 là 192.168.1.1/24
3. Dùng lệnh ipconfig /all để ghi nhận giá trị MAC-address của PC1

MAC PC1:……………………………………… ………

4. Dùng cấu hình port security trên switch:

Switch(config-if)# switchport port--security
Switch(config-if)# switchport port--security maximum 1
Switch(config-if)# switchport port--security mac-address <mac-addr>
Switch(config-if)# switchport port--security violation shutdown
Switch(config-if)#no shutdown

5. Cắm máy PC2 vào port f0/5:

Quan sát trạng thái đèn LED của port f0/5 trên switch.
Dùng lệnh
#show port-security

Switch# show port-security

Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security
Action
(Count) (Count) (Count)
----------------------------------------------------------------------------
---
Fa0/1 11 11 0 Shutdown
Fa0/5 15 5 0 Restrict
Fa0/11 5 4 0 Protect
----------------------------------------------------------------------------
---
Total Addresses in System :21
Max Addresses limit in System :1024

6. Khôi phục port về trạng thái bình thường:

* Dùng lệnh shutdown rồi no shutdown port f0/5
* Dùng lệnh errdisable:

Switch(config)# errdisable recovery cause [all | cause name]
Switch(config)# errdisable recovery interval seconds

7. Đưa máy PC1 vào port f0/5




STORM-CONTROL



COMMAND PURPOSE
Step 1 configure terminal
Step 2 interface f0/5
Step 3 storm-control broadcast level level 1 chỉ ra giớI hạn dành cho broadcast traffic
Step 4 storm-control action shutdown Chỉ ra hành động khi traffic của port vượt quá giới hạn

Thử nghiệm: Dùng lệnh extended ping trên Cisco Router, với địa chỉ đích của gói tin là 255.255.255.255. Trước khi thử nghiệm, đưa port f0/5 về tốc độ 10Mbps

swxx#sh storm-control
Interface Filter State Trap State Upper Lower Current Traps Sent
--------- ------------- ------------- ------- ------- ------- ----------
Fa0/1 Forwarding Below rising 1.00% 1.00% 0.83% 0
Fa0/2 inactive inactive 100.00% 100.00% N/A 0
Fa0/3 inactive inactive 100.00% 100.00% N/A 0
Fa0/4 inactive inactive 100.00% 100.00% N/A 0
Fa0/5 inactive inactive 100.00% 100.00% N/A 0
Fa0/6 inactive inactive 100.00% 100.00% N/A 0
Fa0/7 inactive inactive 100.00% 100.00% N/A 0
Fa0/8 inactive inactive 100.00% 100.00% N/A 0
Fa0/9 Forwarding inactive 1.00% 1.00% 0.00% 0
Fa0/10 inactive inactive 100.00% 100.00% N/A 0
Fa0/11 inactive inactive 100.00% 100.00% N/A 0
Fa0/12 inactive inactive 100.00% 100.00% N/A 0
Fa0/13 inactive inactive 100.00% 100.00% N/A 0
Fa0/14 inactive inactive 100.00% 100.00% N/A 0
Fa0/15 inactive inactive 100.00% 100.00% N/A 0
Fa0/16 inactive inactive 100.00% 100.00% N/A 0
Fa0/17 inactive inactive 100.00% 100.00% N/A 0
Fa0/18 inactive inactive 100.00% 100.00% N/A 0
Fa0/19 inactive inactive 100.00% 100.00% N/A 0
Fa0/20 inactive inactive 100.00% 100.00% N/A 0
Fa0/21 inactive inactive 100.00% 100.00% N/A 0
Fa0/22 inactive inactive 100.00% 100.00% N/A 0
Fa0/23 inactive inactive 100.00% 100.00% N/A 0
Fa0/24 inactive inactive 100.00% 100.00% N/A 0
swxx#
01:08:36: %STORM_CONTROL-2-SHUTDOWN: Storm control shut down FastEthernet0/1
01:08:38: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
01:08:39: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

nhatphuc
01-08-2005, 08:09 AM
Sao mình không thấy lệnh storm-control action vậy admin?

Mình thử tình huống sau gặp problem, mong mọi người chỉ giúp.

Mình config storm control như sau:

interface f0/1
storm-control unicast level 0.1

Sau đó mình mở khoảng 50 cửa sổ DOS, và ping địa chỉ int vlan 1:
ping 192.168.0.1 -t -l 17000 -w 1

Xem show storm-control f0/1 unicast:

Switch#sh storm-control fastEthernet 0/1 unicast
Interface Filter State Level Current
--------- ------------- ------- -------
Fa0/1 Blocking 0.1% 5.35%

Current luôn luôn > 5%

Nhưng không hiểu sao số các packet ping request time out lại rất ít so với reply.

Sau đó, mình disable storm-control:

no storm-control unicast level

thì số packet request time vẫn như cũ, không reply from... 100%.

Hình như storm-control chưa họat động. Mình có cần phải thêm lệnh gì không? Mình không thấy lệnh storm-control action

Thanks

Phúc

cisco336
13-08-2005, 11:20 AM
Bạn đang sử dụng switch 2950 ? Nếu là 2950 thì bảo đảm vesion phải tối thiểu là 12.1(6)EA2
Với các version mới, bạn nên thấy lệnh storm-control action

nhatphuc
13-08-2005, 10:04 PM
http://www.cisco.com/en/US/products/hw/switches/ps646/products_configuration_guide_chapter09186a008014f3 6b.html

Theo link này thì mình không thấy lệnh storm-control action

Phúc

cisco336
14-08-2005, 12:23 PM
Vậy là bạn đang sử dụng Catalyst 3550 switch. Muốn thấy lệnh :

storm-control action {shutdown | trap}

IOS của Catalyst 3550 tối thiểu phải là 12.2(25)SE

nhatphuc
14-08-2005, 10:37 PM
Nếu vậy với IOS hiện tại (12.1(13))của mình có sử dụng được feature storm-control không? Ngoài ra, mình đang có một số version khác là: 12.1(14), 12.1(19, 12.1(20, 12.1(22). Trong những IOS này, IOS nào dùng được?

Nếu không được bạn có 12.2(25)SE không? Có thể share cho mình?

Thanks nhiều

Phúc