思科交換機基本配置

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

思科交換機基本配置

  交換機配置命令基礎

用戶模式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: ;查看閃存