當前位置:學問君>人在職場>電腦培訓>

思科交換機基本配置

學問君 人氣:1.02W

下面是交換機的基礎命令的介紹,,以下知識點都是新手在學習甚至思科認證中必會的,內容不多,希望你已經理解。

思科交換機基本配置

交換機配置命令基礎

用戶模式hostname# ;

特權模式hostname(config)# ;

全局配置模式hostname(config-if)# ;

交換機口令設定:

switch>enable ;進入特權模式

switch#config terminal ;進入全局配置模式

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#exit ;返回命令

交換機基本配置

包括VLAN創建,刪除,端口屬性的`設定,配置trunk端口,將某端口加入vlan中,配置VTP:

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)#duplex ? 檢視duplex的子命令

switch(config)#duplex full 設定該端口爲全雙工(auto/half)

switch(config)#description TO_PC1 這是該端口描述爲TO_PC1

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 ;設定IP位址

switch(config)#ip default-gateway ;設定默認網關

switch(config)#ip domain-name 設定域名

switch(config)#ip name-server 設定域名服務器

switch(config)#mac-address-table? 檢視mac-address-table的子命令

switch(config)#mac-address-table aging-time 100 設定超時時間爲100ms

switch(config)#mac-address-table permanent f0/3 加入永久地址在f0/3端口

switch(config)#mac-address-table restricted static f0/6 f0/7 加入靜態地址目標端口f0/6源端口f0/7

switch(config)#end

switch#show mac-address-table 檢視整個MAC地址表

switch#clear mac-address-table restricted static 清除限制性靜態地址

交換機顯示命令

switch#write ;儲存配置資訊

switch#show vtp ;檢視vtp配置資訊

switch#show run ;檢視當前配置資訊

switch#show vlan ;檢視vlan配置資訊

switch#show interface ;檢視端口資訊

switch#show int f0/0 ;檢視指定端口資訊

switch#show int f0/0 status;檢視指定端口狀態

switch#dir flash: ;檢視閃存