思科基礎(chǔ)知識(shí):第二層交換(4)
第二層交換—設(shè)置主機(jī)名
給1900配置主機(jī)名,使用hostname命令,如下:
- (config)#hostname SZ_Switch
- SZ_Switch(config)#
給2950配置主機(jī)名,使用hostname命令,如下:
- Switch(config)#hostname SZ_Switch
- SZ_Switch(config)#
第二層交換—設(shè)置IP信息
你可以不配置IP信息,直接把線纜插進(jìn)端口,一樣可以工作.配置IP地址信息有2點(diǎn)原因:
1.通過(guò)telnet或其他軟件方式來(lái)管理switch
2.配置VLANs和其他等網(wǎng)絡(luò)功能
默認(rèn)下,沒(méi)有IP地址和默認(rèn)網(wǎng)關(guān)信息配置,在1900下,使用show ip命令查看默認(rèn)IP配置,如下:
- 1900#sh ip
- IP Address: 0.0.0.0
- Subnet Mask: 0.0.0.0
- Default Gateway: 0.0.0.0
- Management VLAN: 1
- Domain name:
- Name server 1: 0.0.0.0
- Name server 2: 0.0.0.0
- HTTP server: Enable
- HTTP port: 80
- RIP: Enable
在1900下使用ip address和ip default-gateway命令來(lái)配置IP地址信息和默認(rèn)網(wǎng)關(guān)信息,如下:
- 1900(config)#ip address 172.16.10.16 255.255.255.0
- 1900(config)#ip default-gateway 172.16.10.1
- 1900(config)#
2950下的配置是在VLAN1接口下配置,VLAN1是管理VLAN,默認(rèn)所有接口均是VLAN1的成員,配置如下:
- 2950(config)#int vlan1
- 2950(config-if)#ip address 172.16.10.17 255.255.255.0
- 2950(config-if)#no shut
- 2950(config-if)#exit
- 2950(config)#ip default-gateway 172.16.10.1
- 2950(config)#
注意2950的IP地址配置是在VLAN1接口下,另外要注意打開(kāi)接口。
【編輯推薦】