思科交換機(jī)的基本配置命令學(xué)習(xí)小結(jié)
2024-09-12 21:54:53
供稿:網(wǎng)友
思科交換機(jī)的基本配置命令學(xué)習(xí)
CISCO交換機(jī)基本配置:Console端口連接
用戶模式hostname# ;
特權(quán)模式hostname(config)# ;
全局配置模式hostname(config-if)# ;
交換機(jī)口令設(shè)置:
switch>enable ;進(jìn)入特權(quán)模式
switch#config terminal ;進(jìn)入全局配置模式
switch(config)#hostname csico ;設(shè)置交換機(jī)的主機(jī)名
switch(config)#enable secret csico1 ;設(shè)置特權(quán)加密口令
switch(config)#enable password csico8 ;設(shè)置特權(quán)非密口令
switch(config)#line console 0 ;進(jìn)入控制臺(tái)口
switch(config-line)#line vty 0 4 ;進(jìn)入虛擬終端
switch(config-line)#login ;虛擬終端允許登錄
switch(config-line)#password csico6 ;設(shè)置虛擬終端登錄口令csico6
switch#exit ;返回命令
交換機(jī)VLAN創(chuàng)建,刪除,端口屬性的設(shè)置,配置trunk端口,將某端口加入vlan中,配置VTP:
switch#vlan database ;進(jìn)入VLAN設(shè)置
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 ;進(jìn)入端口1
switch(config)#speed ? 查看speed命令的子命令
switch(config)#speed 100 設(shè)置該端口速率為100mb/s (10/auto)
switch(config)#duplex ? 查看duplex的子命令
switch(config)#duplex full 設(shè)置該端口為全雙工(auto/half)
switch(config)#description TO_PC1 這是該端口描述為TO_PC1
switch(config-if)#switchport access vlan 2 ;當(dāng)前端口加入vlan 2
switch(config-if)#switchport mode trunk ;設(shè)置為trunk模式(access模式)
switch(config-if)#switchport trunk allowed vlan 1,2 ;設(shè)置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設(shè)置vlan 中繼
switch(config)#vtp domain vtpserver ;設(shè)置vtp域名相同
switch(config)#vtp password ;設(shè)置發(fā)vtp密碼
switch(config)#vtp server ;設(shè)置vtp服務(wù)器模式
switch(config)#vtp client ;設(shè)置vtp客戶機(jī)模式
交換機(jī)設(shè)置IP地址,默認(rèn)網(wǎng)關(guān),域名,域名服務(wù)器,配置和查看MAC地址表:
switch(config)#interface vlan 1 ;進(jìn)入vlan 1
switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;設(shè)置IP地址
switch(config)#ip default-gateway 192.168.1.6 ;設(shè)置默認(rèn)網(wǎng)關(guān)
switch(config)#ip domain-name cisco.com 設(shè)置域名
switch(config)#ip name-server 192.168.1.18 設(shè)置域名服務(wù)器
switch(config)#mac-address-table? 查看mac-address-table的子命令
switch(config)#mac-address-table aging-time 100 設(shè)置超時(shí)時(shí)間為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 加入靜態(tài)地址目標(biāo)端口f0/6源端口f0/7
switch(config)#end
switch#show mac-address-table 查看整個(gè)MAC地址表
switch#clear mac-address-table restricted static 清除限制性靜態(tài)地址