交換機端和MAC地址表的設置_第1頁
交換機端和MAC地址表的設置_第2頁
交換機端和MAC地址表的設置_第3頁
交換機端和MAC地址表的設置_第4頁
交換機端和MAC地址表的設置_第5頁
已閱讀5頁,還剩9頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、3.3 實驗2:交換機端和mac地址表的設置本實驗是對cisco catalyst 1900系列交換機的端口和mac地址表相關的項目進行設置。1.實驗目的通過本實驗,讀者可以掌握以下技能:設置交渙機端口屬性;查看交換機端口配置和統(tǒng)計信息;設置靜態(tài)mac地址和查看mac地址表。2. 設備需求本實驗需要以下設備:cisco catalyst 1900系列交換機1臺,型號不限,企業(yè)版軟件,本實驗中使用了1912交換機;帶網卡的pc機2臺,網線2條;pc機1臺,操作系統(tǒng)為windows系列,裝有超級終端程序;console電纜1條及相應的接口轉換器。3. 線纜連接及配置說明如圖3.2所示,把pc機連接

2、在交換機的eo/9和eo/11兩個端口上。連接pc機的目的是為了進行mac地址表方面的實驗,當然此處的pc機也可以便用路由器來代替。圖示中略去了作為超級終端的pc機及控制電纜。 4. 實驗配置及監(jiān)測結果按實驗2的圖示把設備連接好后,給所有設備加電,開始實驗。監(jiān)測清單3-2記錄了本實驗的操作。監(jiān)測清單3-2配置端口屬性及mac地址表第1段:配置端口屬性及mac地址表sw1912#conf tenter configuration commands, one per line. end with cntl/zsw1912(config)#mterface ethernet 0/1sw1912(co

3、nfig-if)#?interface configuration commands:cdp cdp interface subcommandsdescription interface specific descriptionduplex con-figureduplexoperationexit exit from interface configuration modehelp description of the interactive help systemno negate a conanaand or set its defaultsport perform switch por

4、t configurationshutdown shutdown the selected interfacespantree spanning tree subsystemvlan-membership vlan membership configurationsw1912(config-if)#description pc_1sw1912(config-if)#duplex ?auto enable auto duplex-configurationfull force full duplex operationfull-flow-control force full duplex wit

5、h flow contro1half forcehalfduplexoperationsw 1912(config-if)#duplex fullsw1912(config-if)#port secure ?max-mac-count maxirnum number of addresses allowed on the portsw1912(config-if)#port secure max-mac-couist 1sw1912(config-if)#endsw1912#sh mac-address-table ?address mac addressaging-time show agi

6、ng time of dynamic entriesdynamic show 802.1 d dynamic addressinterface interface namepermanent show 802.1 d permanent addressrestricted show 802. 1 d restricted static addressessecurity show addressing security informationsw1912#sh mac-address-table securityaction upon address violation : suspendin

7、terface addressing security address table size clear addressethernet 0/1 enabled 1 noethernet 0/2 disabled n/a noethernet 0/3 disabled n/a noethernet 0/4 disabled n/a noethernet 0/5 disabled n/a noethernet 0/6 disabled n/a noethernet 0/7 disabled n/a noethernet 0/8 disabled n/a noethernet 0/9 disabl

8、ed n/a noethernet 0/10 disabled n/a noethernet 0/11 disabled n/a noethernet 0/12 disabled n/a noethernet 0/25 disabled n/a nofastethernet 0/26 disabled n/a nofastethernet 0/27 disabled n/a nosw1912#第2段:配置和查看mac地址表sw1912(config)#mac-address-table ?aging-time aging time of dynamic addressespermanent c

9、onfigure a permanent addressrestricted configure a restricted static addresssw1912(config)#mac-address-table aging-time ?sw1912(config)#mac-address-table permanent ?h.h.h 48 bit hardware addresssw1912(config)#mac"address-tabae permanent 0000.0c10.aabb ?ethernet ieee 802.3fastethernet fastethern

10、et ieee 802.3sw1912(config)#mac-address-table permanent 0000.0cl0.aabb e0/3sw1912(config)#mac-address-table restricted static oooo.oc11.aacc e0/6 e0/7sw1912(config)#endsw1912#sh mac-address-tablenumber of permanent addresses : 1number of restricted static addresses : 1number of dynamic addresses : 2

11、address dest interface type source interface list-0000.0c10.aabb ethernet0/3 permanent all0000.0c11.aacc ethernet0/6 static et0/70000.0c8e.cdd2 ethernet0/11 dynamic all0000.0c76.f737 ethernet0/9 dynamic allsw1912#clear mac-addr restric staticsw1912#sh mac-addrnumber of permanent addresses:1number of

12、 restricted static add resses:0number of dynamic addresses:2address dest interface type source interface list-0000.0c10.aabb ethernet0/3 permanent all0000.0c8e.cdd2 ethernet0/11 dynamic all0000.0c76.f737 ethernet0/9 dynamic all(1)進入接口配置模式。鍵入問號,列出所有此接口下可以進行的設置命令和簡短的說明。(2)使用description pc_1命令設置了eo/1接口

13、的描述為"pc_1",這樣在交換機上就可以方便地查到與對應端口相連的設備是什么。(3)一個端口的雙工模式可以分為由duplex?命令所列出的幾種:auto:自動匹配雙工模式;full:強制為全雙工模式;full-flow-control:帶流量控制的全雙工模式;half:強制為半雙工模式。(4)端口安全性命令ponsecufe啟動了端口安全特性。缺省情況下,可最多有132個目的mac地址與設置了port secure命令的端口相對應。該端口所對應的mac地址在mac地址中(mac address table)不會以動態(tài)類型出現,而是自動轉換成為靜態(tài)類型,直到達到所設定的最大

14、值(缺省為132)時為止。到達最大值之后,新的mac地址不再被接收。(5)在接口配置模式下發(fā)出的port sccure max-mac-count命令限定對應本端口的mac地址的最大數量,實驗中設置為1,即只允許1個mac地址通過此端口連入網絡。(6)使用show mac-address-table security命令可以查看被設置了安全性的端口的狀態(tài),可以看到端口eo/1己經被設置為安全端口,其地址表大小為1。(7)在第2段中,演示了對mac地址表的有關配置。在全局配置模式下,有關mac地址表的配置有3個:即超時時間、永久地址和限制性地址。(8)使用mac、address-table ag

15、ing-time命令可以設置mac地址表超時時間,交換機學習到的動態(tài)mac地址的超時時間缺省為300s,可以通過命令更改這一數值。(9)mac、address-table permanent 0000.0c10.aabbe0/3命令對于端口e0/3設置了1個靜態(tài)mac地址,這個地址永久存在于mac地址表中。不會超時,所有的端口均可轉發(fā)以太網幀給e0/3端口。(10)所謂限制性靜態(tài)(restricted static)地址是在永久地址的基礎上,同時限制了源端口,其安全性更高。通過mac-address-table restricted static 0000.0c11.aacc e0/6e0/7

16、命令設置對于e0/6端口的靜態(tài)mac地址為0000.0c11.aacc,其限制性端口為e0/7,即只有e0/7端口可以轉發(fā)以太網幀給這個mac地址。(1l)show mac-address-table命令用來查看整個mac地址表??梢钥吹?,永久地址有1個,設置在e0/3端口上;限定性靜態(tài)地址有1個,設置的目標端口為e0/6,源端口為e0/7;動態(tài)類型的mac地址有2個。分別是pc1和pc2網卡上的mac地址。(12)用clear mac-address restric static命令清除了限定性靜態(tài)地址之后,show mac-address-table顯示限定性靜態(tài)地址已不在mac地址表中出

17、現。cisco3524交換機配置vlan實例cisco 3548(3524) 交換機: 第一次連接交換機,配置終端參數為: 波特率:9600;數據位:8;停止位:1;奇偶校驗:無;流控制:無。 通過串口線連上路由器后,按回車,即可看到配置向導: (如果不是第一次配置,可以進入超級用戶模式后用命令setup調用以下過程) - system configuration dial og - at any point you may enter a question mark ? for help.任何時候可以打?取得幫助 use ctrl-c to abort configuration dialo

18、g at any prompt.按ctrl-c可以取消并退出 default settings are in square brackets .默認參數在中 continue with configuration dialog? yes/no: y繼續(xù)交互配置嗎?回答:y enter ip address: 49ip地址 enter ip netmask: 子網掩碼 would you like to enter a default gateway address? yes: y設置默認網關?y ip address of default gatewa

19、y: 54默認網關 enter host name 3548_9a: the enable secret is a one-way cryptographic secret used instead of the enable password when it exists. enter enable secret: _password輸入超級用戶密碼 would you like to configure a telnet password? yes: y enter telnet password: _password輸入telnet密碼 would you like to

20、 enable as a cluster command switch? yes/no: n集群模式?n the following configuration command script was created:已建立以下配置信息 ip subnet-zero interface vlan1 ip address 49 ip default-gateway 54 enable secret 5 $1$biz3$aolb9cmttbwmtgb9lybzr. line vty 0 15 password _domainwlzx snm

21、p community private rw snmp community public ro ! end use this configuration? yes/no:使用該配置信息嗎? y 修改配置: 禁止通過snmp管理: 3548>enable password: 3548#config term 3548(config)#no snmp community private 3548(config)#no snmp community public 接著配置干道:(確定上級交換機對應端口已設為干道模式) 3548(config)#inter g0/1 選擇第一個千兆口 3548(

22、config if)# switchport mode trunk設為干道模式 如果g0/2用于連接另一臺3548,也設為干道 3548(config)#inter g0/2 3548(config if)# switchport mode trunk 返回 3548(config if)# exit 3548(config)# exit 3548# 驗證: ping 54 配置vlan數據: 3548#vlan database 3548(vlan)#reset清除以前的配置 3548(vlan)#vtp client設為vtp客戶模式 3548(vlan)#vtp doma

23、in _domainvtp域是_domain 3548(vlan)#vtp password *設定vtp域密碼 3548(vlan)#exit 3548# 驗證:show vtp status顯示vlan 數據 show vtp counters show vlan 同步后看到的vlan數目和名稱應與6506上的一致 指定端口到vlan、配置端口為portfast方式(快速建立連接): 方法1:命令方式 3548#config term 3548(config)#inter f0/1配置1號快速以太網端口 3548(config if)# switchport access vlan 2指定

24、端口到vlan 2 3548(config if)# spanning-tree portfast配置端口為portfast方式 3548(config)#inter f0/2配置1號快速以太網端口 3548(config if)# switchport access vlan 2指定端口到vlan 2 3548(config if)# spanning-tree portfast配置端口為portfast方式 .對每個要設定的端口重復上述步驟。 3548(config if)# exit 3548(config)# exit 3548# 方法1:web 方式 (預先要安裝插件:jre-1-2

25、-2-005-win-i-09-mar-2000.exe) 打開瀏覽器連接設備:在地址欄輸入設備的管理頁面url,如3548_9a(48)為:49/basiccfg.html 選中菜單port -> port configure -> 設port fast 為enable 選中菜單vlan -> vlan membership -> 指定端口所屬的vlan號 可同時指定多個端口 ! 注意: 如果把一個端口指定到不存在的vlan上,3548交換機的vlan同步會異常,此時應該為正確vlan并重新“配置vlan數據” 保存配置信息

26、: 方法1:命令方式 3548# write ( 或 copy running-config startup-config ) 方法1:web 方式 選中設備(而不是單個端口),點擊save configure按鈕。 3548_9a#show run building configuration. current configuration: ! version 12.0#軟件版本 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption

27、 ! hostname 3548_9a#系統(tǒng)名稱 ! enable secret 5 $1$4zms$rfc.g/nn.owt3ew2uocl/0#加密后的enable密碼 ! ! ! ! ! ! ip subnet-zero ! ! ! interface fastethernet0/1#模塊0的1號快速以太網接口 switchport access vlan 5#指定端口0/1到vlan 5 spanning-tree portfast#如果接的是工作站,指定端口為portfast方式(不運行生成樹協(xié)議,加快建立連接速度) ! interface fastethernet0/2 spann

28、ing-tree portfast#默認情況下端口屬vlan 1 ! interface fastethernet0/3 spanning-tree portfast ! interface fastethernet0/4 spanning-tree portfast ! interface fastethernet0/5 spanning-tree portfast ! interface fastethernet0/6 spanning-tree portfast ! interface fastethernet0/7 spanning-tree portfast ! interface

29、fastethernet0/8 spanning-tree portfast ! interface fastethernet0/9 spanning-tree portfast ! interface fastethernet0/10 spanning-tree portfast ! interface fastethernet0/11 spanning-tree portfast ! interface fastethernet0/12 spanning-tree portfast ! interface fastethernet0/13 spanning-tree portfast !

30、interface fastethernet0/14 spanning-tree portfast ! interface fastethernet0/15 spanning-tree portfast ! interface fastethernet0/16 spanning-tree portfast ! interface fastethernet0/17 spanning-tree portfast ! interface fastethernet0/18 spanning-tree portfast ! interface fastethernet0/19 spanning-tree

31、 portfast ! interface fastethernet0/20 spanning-tree portfast ! interface fastethernet0/21 spanning-tree portfast ! interface fastethernet0/22 spanning-tree portfast ! interface fastethernet0/23 spanning-tree portfast ! interface fastethernet0/24 spanning-tree portfast ! interface fastethernet0/25 s

32、panning-tree portfast ! interface fastethernet0/26 spanning-tree portfast ! interface fastethernet0/27 spanning-tree portfast ! interface fastethernet0/28 spanning-tree portfast ! interface fastethernet0/29 spanning-tree portfast ! interface fastethernet0/30 spanning-tree portfast ! interface fastet

33、hernet0/31 spanning-tree portfast ! interface fastethernet0/32 spanning-tree portfast ! interface fastethernet0/33 spanning-tree portfast ! interface fastethernet0/34 spanning-tree portfast ! interface fastethernet0/35 spanning-tree portfast ! interface fastethernet0/36 spanning-tree portfast ! inte

34、rface fastethernet0/37 spanning-tree portfast ! interface fastethernet0/38 spanning-tree portfast ! interface fastethernet0/39 spanning-tree portfast ! interface fastethernet0/40 spanning-tree portfast ! interface fastethernet0/41 spanning關于ip-mac地址綁定的交換機設置1.方案1基于端口的mac地址綁定思科2950交換機為例,登錄進入交換機,輸入管理口令

35、進入配置模式,敲入命令:switch#config terminal進入配置模式switch(config)# interface fastethernet 0/1進入具體端口配置模式switch(config-if )#switchport port-secruity配置端口安全模式switch(config-if )switchport port-security mac-address mac(主機的mac地址)配置該端口要綁定的主機的mac地址switch(config-if )no switchport port-security mac-address mac(主機的mac地址)刪

36、除綁定主機的mac地址注意:以上命令設置交換機上某個端口綁定一個具體的mac地址,這樣只有這個主機可以使用網絡,如果對該主機的網卡進行了更換或者其他pc機想通過這個端口使用網絡都不可用,除非刪除或修改該端口上綁定的mac地址,才能正常使用。注意:以上功能適用于思科2950、3550、4500、6500系列交換機2.方案2基于mac地址的擴展訪問列表switch(config)mac access-list extended mac10定義一個mac地址訪問控制列表并且命名該列表名為mac10switch(config)permit host 0009.6bc4.d4bf any定義mac地址為

37、0009.6bc4.d4bf的主機可以訪問任意主機switch(config)permit any host 0009.6bc4.d4bf定義所有主機可以訪問mac地址為0009.6bc4.d4bf的主機switch(config-if )interface fa0/20#進入配置具體端口的模式switch(config-if )mac access-group mac10 in在該端口上應用名為mac10的訪問列表(即前面我們定義的訪問策略)switch(config)no mac access-list extended mac10清除名為mac10的訪問列表此功能與應用一大體相同,但它是

38、基于端口做的mac地址訪問控制列表限制,可以限定特定源mac地址與目的地址范圍。注意:以上功能在思科2950、3550、4500、6500系列交換機上可以實現,但是需要注意的是2950、3550需要交換機運行增強的軟件鏡像(enhanced image)。3.方案3ip地址的mac地址綁定只能將應用1或2與基于ip的訪問控制列表組合來使用才能達到ip-mac 綁定功能。switch(config)mac access-list extended mac10定義一個mac地址訪問控制列表并且命名該列表名為mac10switch(config)permit host 0009.6bc4.d4bf

39、any定義mac地址為0009.6bc4.d4bf的主機可以訪問任意主機switch(config)permit any host 0009.6bc4.d4bf定義所有主機可以訪問mac地址為0009.6bc4.d4bf的主機switch(config)ip access-list extended ip10定義一個ip地址訪問控制列表并且命名該列表名為ip10switch(config)permit any定義ip地址為的主機可以訪問任意主機permit any 定義所有主機可以訪問ip地址為

40、的主機switch(config-if )interface fa0/20#進入配置具體端口的模式switch(config-if )mac access-group mac10 in在該端口上應用名為mac10的訪問列表(即前面我們定義的訪問策略)switch(config-if )ip access-group ip10 in在該端口上應用名為ip10的訪問列表(即前面我們定義的訪問策略)switch(config)no mac access-list extended mac10清除名為mac10的訪問列表switch(config)no ip access-group ip10 in清除名為ip10的訪問列表上述所提到的應用1是基于主機mac地址與交換機端口的綁定,方案2是基于mac地址的訪問控制列表,前兩種方案所能實現的功能大體一樣。如果要做到ip與mac地址的綁定只能按照方案3來實現,可根據需求將方案1或方案2與ip訪問控制列表結合起來使用以達到自己想要的效果。注意:以上功能在思科2950、3550、4500、6500系列交換機上可以實現,但是需要注意的是2950、3550需要交換機運行增強的軟件鏡像(enha

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論