㈠ 交換機如何建立MAC地址表
A通訊B 通過交換機上多對應關系建立mac地址表,就是所謂的源攜帶過來的包攜帶的目的地址版在尋找B的埠,出自身權外,會向其他所有埠泛洪。待得到回應時就得到了mac地址及介面。mac表就會有 源和目的地介面對應關系。mac地址就建立了。
㈡ 交換機如何學習mac地址過程
我說簡單點,來交換機工自作在數據鏈接層,當一台主機發送數據時,交換機會收到mac幀,我包含發送主機的mac地址和接收主機的地址,交換機收到這個幀後,會把這個發送主機的mac地址記錄在自己的mac表中,並記下這個發送主機對應的埠號。之後交換機會查看自己mac表看有沒得接收主機的記錄,如果有就直接發到對應的埠,如果沒有就廣播出去(這里還涉及到arp協議,反正大體就是這個意,我自己寫的,嘿嘿)
㈢ 華為交換機知道IP怎麼查看設備mac地址
.對於連接終端設備的交換機來說,直接運行display arp 即可,彈出的詳細信息里,IP地址後專面有所在端屬口;
2.如果是處在第二層的話,只能用display mac-address來查看埠下的MAC,然後在三層上用display arp 找IP對應的MAC,通過IP後面的埠號就可以知道二層某個埠下所連接的設備信息。
㈣ 如何在CISCO交換機配置動態學習MAC地址,並保存到NVRAM,然後重啟不丟失!求教!
通常動態學到的mac不會保存到nvram的,除非你交換機配置了埠粘滯安全MAC地址,交換機內就會將學習到的容mac增加到運行配置里。基本的命令是switchport port-security mac-address sticky,你可以搜一下埠安全性看看。
㈤ 交換機是如何建立起它的MAC地址表的
1給2發消來息
首先生成數據 IP層封裝自為包 2層封裝為FRAME,傳到交換機
交換機就會記錄 1----MAC1
然後查詢2的MAC和埠
但是發現找不到 就會從除1外所有埠廣播出去
2再回發的時候就會記錄 2----MAC2
這樣通過 FRAME的源地址來學習地址表.
㈥ 如何配置交換機的mac地址表
cisco交換機配置清除、啟動及基本配置 CISCO交換機基本配置
switch>ena 進入特權模式
switch#erase nvram 全部清除交換機的所有配置
switch#reload 重新啟動交換機(初始提示符為switch> )
------------------------------------------------------------------------------------
CISCO交換機基本配置:Console埠連接
用戶模式hostname> ;
特權模式hostname(config)# ;
全局配置模式hostname(config-if)# ;
交換機口令設置:
switch>enable ;進入特權模式
switch#config;進入全局配置模式
switch(config)#hostname csico ;設置交換機的主機名
switch(config)#enable secret csico1 ;設置特權加密口令
switch(config)#enable password csico8 ;設置特權非密口令
switch(config)#line console 0 ;進入控制台口
switch(config-line)#line vty 0 4 ;進入虛擬終端
switch(config-line)#login ;虛擬終端允許登錄
switch(config-line)#password csico6 ;設置虛擬終端登錄口令csico6
switch#write 保存配置設置
switch# running-config startup-config 保存配置設置,與write一樣
switch#exit ;返回命令
配置終端過一會時間就會由全局配置模式自動改為用戶模式,將超時設置為永不超時
switch#conf t
switch(config)#line con 0
switch(config-line)#exec-timeout 0
---------------------------------------------------------------------------------
交換機顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當前配置信息
switch#show vlan ;查看vlan配置信息
switch#show vlan name vlan2
switch#show interface ;查看埠信息
switch#show int f0/0 ;查看指定埠信息
switch#show int f0/0 status;查看指定埠狀態
switch#show interface status
switch#dir flash: ;查看快閃記憶體
switch#show running-config
switch(config)#do show running-config 顯示存儲在內存中的當前正確配置文件。
show startup-configuration:顯示存儲在非易失性存儲器(NVRAM)的配置文件。
show users:顯示所有連接到路由器的用戶。
show hosts:顯示主機名和地址信息。
switch(config)#do show interface
switch(config-if)#do show int f0/21
switch#show arp
switch#show mac-address-table
------------------------------------------------------------------------------
2960交換機上配置,配置IP及網關
switch#conf t
switch(config)#interface vlan1 進入vlan 1特殊介面配置模式
switch(config-if)#ip address 192.168.1.1 255.255.255.0 設置交換機的管理IP地址
switch(config)#ip default-gateway 192.168.1.1 設置交換機的網關地址
switch(config)#ip domain-name pctc.com.cn 設置交換機所連域的域名
switch(config)#no ip domain-name
switch#ip name-server 218.87.18.230 設置交換機所連域的域名伺服器IP
switch#show int vlan 1 查看交換機的VLAN 1特殊介面配置信息
switch#show run 查看交換機的當前運行配置等全部信息
--------------------------------------------------------------------------------
交換機VLAN創建,刪除,埠屬性的設置,配置trunk埠,將某埠加入vlan中,配置VTP:
switch(config)#vlan 2
switch#vlan database ;進入VLAN設置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#vlan 3 name vlan3 ;建VLAN 3並命名為vlan3
switch(vlan)#no vlan 2 ;刪vlan 2
switch(config)#int f0/1 ;進入埠1
switch(config)#speed ? 查看speed命令的子命令
switch(config)#speed 100 設置該埠速率為100mb/s (10/auto)
switch(config-if)#do show int f0/21 顯示21口配置信息
switch(config-if)#shut ;shutdown 關閉當前埠
switch(config-if)#no shut ;no shutdown 開啟當前埠
switch(config)#plex ? 查看plex的子命令
switch(config)#plex full 設置該埠為全雙工(auto/half)
switch(config)#description TO_PC1 這是該埠描述為TO_PC1
switch(config)#interface f0/21
switch(config-if)#switchport access vlan 2 ;當前埠加入vlan 2
switch(config-if)#switchport mode trunk ;設置為trunk模式(access模式)
switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼
switch(config)#vtp domain vtpserver ;設置vtp域名相同
switch(config)#vtp password ;設置發vtp密碼
switch(config)#vtp server ;設置vtp伺服器模式
switch(config)#vtp client ;設置vtp客戶機模式
---------------------------------------------------------------------------------------
交換機設置IP地址,默認網關,域名,域名伺服器,配置和查看MAC地址表:
switch(config)#interface vlan 1 ;進入vlan 1
switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;設置IP地址
switch(config)#ip default-gateway 192.168.1.6 ;設置默認網關
switch(config)#ip domain-name cisco.com 設置域名
switch(config)#ip name-server 192.168.1.18 設置域名伺服器
switch(config)#mac-address-table? 查看mac-address-table的子命令
switch(config)#mac-address-table aging-time 100 設置超時時間為100ms
switch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3埠
switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入靜態地址目標埠f0/6源埠f0/7
switch(config)#end
switch#show mac-address-table 查看整個MAC地址表
switch#clear mac-address-table restricted static 清除限制性靜態地址
-----------------------------------------------------------------------------------
交換機埠加入vlan
將多個埠加入到VLAN2
switch(config)#interface range fa 0/17-24
switch(config-if-range)#switchport access vlan 2
單個埠加入VLAN
switch(config)#interface f0/1
switch(config-if-range)#switchport access vlan 2
--------------------------------------------------------------------------------
交換機的埠和MAC地址表的設置
2960交換機配置埠屬性
switch#conf t
switch#interface ethernet 0/1
進入第1個埠
switch#description switch-e0/1-pc1
給埠寫入注釋信息
switch#plex auto/full/full-flow-control/half
設置埠的工作模式
switch#port secure
啟用埠安全性
switch#port secure max-mac-count 1
設置該埠允許對應的MAC地址數(默認132個)
switch#sh mac-address-table security
查看埠安全性
2912交換機配置埠屬性
switch#conf t
進入全局配置模式
switch#interface fastethernet 0/1
進入第1個埠
switch#description switch-f0/1-pc1
給埠寫入注釋信息
switch#plex auto/full/half
設置埠的工作模式
switch#port security
啟用埠安全性
switch#port security max-mac-count 1
設置該埠允許對應的MAC地址數(默認132個)
switch#end
返回特權模式
switch#sh port security
查看埠安全性
配置和查看MAC地址表
1924交換機配置MAC地址表
switch#mac-address-table aging-time 600
設置動態地址超時時間
switch#mac-address-table permanent 0000.0cdd.5a4d e0/3
定義永久MAC地址(綁定MAC地址)
switch#mac-address-table restricted static 0000.0cdd.aaed e0/6 e0/7
定義受限MAC地址
switch#address-violation disable/ignore/suspend
定義地址安全違規
switch#show mac-address-table
查看上述配置
switch#clear mac-addr restric static
清除受限MAC地址表項
2912交換機配置MAC地址表
switch#mac-address-table aging-time 700
設置動態地址超時時間
switch#mac-address-table static 0000.0cdd.5a4d e0/3
定義永久MAC地址(綁定MAC地址)
switch#mac-address-table secure 00d0.f80d.3333 f0/3 vlan 1
定義受限MAC地址
switch#port security action shutdown/trap
定義地址安全違規
switch#show port security
查看上述配置
配置VTP、VLAN、VLAN Trunk和STP
配置VTP
switch#conf t
switch#vtp server
定義VTP的工作模式
switch#vtp domain cisco
定義VTP的域名
switch#trunk on
啟用幹道
switch#vtp domain cisco
加入VTP域
switch#vtp client
定義VTP的工作模式
switch#trunk on
啟用幹道
switch#show trunk b
switch#show trunk b allowed-vlans
查看幹道信息
配置VLAN
switch#vlan 10 dept1
switch#vlan 20 dept2
switch#vlan 30 dept3
switch#vlan 40 dept4
定義所需VLAN
switch#show vlan
查看VLAN信息
switch#show vlan
switch#show vtp
查看VTP的信息
switch#int e0/1
switch#vlan-membership static 10
switch#int e0/2
switch#vlan-membership static 20
switch#int e0/3
switch#vlan-membership static 30
switch#int e0/4
switch#vlan-membership static 40
把介面劃入各自VLAN
配置spanning tree
switch#spantree 1
啟用生成樹協議
switch#sh spantree 1
查看生成樹信息
switch#no spantree 1
關閉生成樹協議
switch#sh spantree 1
查看生成樹信息
交換機上屏蔽個別MAC地址方法
configure terminal
interface gigabitEthernet 0/20
switchport
sw mode acc
sw port-sec
sw port-sec mac-add [macaddress]
sw port-sec max 1
sw port-sec violation restrict
㈦ 怎麼在交換機上獲取終端的MAC地址
輸入show arp會顯示每個IP所對應的MAC地址和連接在設備上的埠號我給你看下我交換機上的埠SW-A#sho arp
Protocol Address Age(min) Hardware Type Interface
Internet 192.168.80.2 33 001a.a907.bffb arpa FastEthernet 0/10
Internet 192.168.80.1 -- 001a.a91a.09df arpa FastEthernet 0/10
Internet 192.168.50.25 34 001a.a93a.4370 arpa FastEthernet 0/11
Internet 192.168.50.26 -- 001a.a91a.09df arpa FastEthernet 0/11
Internet 192.168.200.10 -- 001a.a91a.09df arpa VLAN 1
Internet 192.168.15.254 -- 001a.a91a.09df arpa VLAN 15
Internet 192.168.20.254 -- 001a.a91a.09df arpa VLAN 20
Total number of ARP entries: 7
㈧ 交換機是如何建立起它的MAC地址表的
1給2發消息
首先生成數據 IP層封裝為包 2層封裝為FRAME,傳到交換機
交換機就會記錄 1----MAC1
然後版查詢2的MAC和埠
但是發現找不到權 就會從除1外所有埠廣播出去
2再回發的時候就會記錄 2----MAC2
這樣通過 FRAME的源地址來學習地址表.
㈨ 如何查看交換機mac地址
如果是華為、H3C的可網管交換機使用 dis mac-address 查看
如果是cisco的 使用show mac-address 查看
如果不是可網管的設備無法查看