(神州數碼)靜態mac地址與端口的綁定

(神州數碼)靜態mac地址與端口的綁定
 
實驗目的
 
         瞭解交換機的mac地址與端口的綁定
          配置mac地址與端口的靜態綁定方式
 
實驗設備

 

 DCS二層交換機
 
 
實驗步驟:
switch(Config)#int vlan 1                        

 

switch(Config-If-Vlan1)#ip add 192.168.1.55 255.255.255.0   

 

switch(Config-If-Vlan1)#no shutdown                    

 

switch(Config-If-Vlan1)#exit                   

 

switch(Config)#int ethernet 0/0/1                       

 

switch(Config-Ethernet0/0/1)#switchport port-security mac-address 00-13-20-D9-66
-DB                                     //配置該端口與主機的mac地址進行綁定

 

switch(Config-Ethernet0/0/1)#exit 
 
驗證配置:

 

使用命令show port-securityshow port-security address查看配置安全端口狀態

switch#show port-security
Security Port    MaxSecurityAddr     CurrentAddr       Security Action
                    (count)               (count)
--------------------------------------------------------------------------------
----
 Ethernet0/0/1             1                  1                  Protect
--------------------------------------------------------------------------------
---
Max Addresses limit per port :128
Total Addresses in System :1
switch#
 
//該信息顯示此接口所綁定主機數量的最大數以及已經被綁定的主機數量。
 
 
Security Mac Address Table
----------------------------------------------------------------------------
Vlan    Mac Address                     Type                    Ports
 1      00-13-20-d9-66-db               SecurityConfigured      Ethernet0/0/1
----------------------------------------------------------------------------
Total Addresses in System :1
Max Addresses limit in System :128
 
//顯示接口所綁定的mac地址
 
有時候爲了更好的使用交換機的接口不僅僅只綁定一個mac地址,交換機上的接口可以綁定多個mac地址同時也可以限制mac地址的最大數量
 

具體操作步驟:

 

switch(Config-Ethernet0/0/1)#switchport port-security maximum 4
                                      //對接口設置mac地址的最大數量限制

 

switch(Config-Ethernet0/0/1)#switchport port-security mac-address aa-aa-aa-11-11-11
                                 
switch(Config-Ethernet0/0/1)#switchport port-security mac-address aa-aa-aa-22-22-22
                          
switch(Config-Ethernet0/0/1)#switchport port-security mac-address aa-aa-aa-33-33-33                                
                                     //配置端口和mac地址之間的綁定
 
 
 

 

驗證配置:
switch#show port-security
Security Port    MaxSecurityAddr     CurrentAddr       Security Action
                    (count)               (count)
--------------------------------------------------------------------------------
----
 Ethernet0/0/1             4                  4                  Protect
--------------------------------------------------------------------------------
---
Max Addresses limit per port :128
Total Addresses in System :4
switch#
 
switch#sh port-security address
Security Mac Address Table
----------------------------------------------------------------------------
Vlan    Mac Address                     Type                    Ports
 1      00-13-20-d9-66-db               SecurityConfigured      Ethernet0/0/1
 1      aa-aa-aa-11-11-11               SecurityConfigured      Ethernet0/0/1
 1      aa-aa-aa-22-22-22               SecurityConfigured      Ethernet0/0/1
 1      aa-aa-aa-33-33-33               SecurityConfigured      Ethernet0/0/1
----------------------------------------------------------------------------
Total Addresses in System :4
Max Addresses limit in System :128
switch#
//端口所綁定mac地址
 
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章