2、理解VTP的工做原理,會配置VTP。 3、會配置交換機的端口安全性。 實驗設備:CISCO2950交換機三臺,PC兩臺,網線若干。 實驗內容: 一、按上圖將交換機和PC鏈接好。 Sw1 port1 ~ sw2 port1 Sw1 port2 ~ sw3 port1 Sw2 port2 ~ sw3 port2 PC1 ~sw1 port 3 PC2 ~sw3 port 3 將三臺交換機分別命名爲SW1、SW2、SW3。Pc1:ip—192.168.1.4/24 Pc2:ip—192.168.3.5/24 二、查看端口轉發模式: Switch#show port system 三、將交換機間互聯的端口模式設置爲trunk. 語法爲:switch(config-if)#switchport mode trunk 四、配置三臺交換機的console 和vty密碼爲cisco. 五、配置vtp域名爲founder,sw1 的模式爲server,sw2和sw3的模式爲client.配置修剪。 語法爲:switch#vlan database Switch(vlan)#vtp domain domain-name Switch(vlan)#vtp client|transparent|server Switch(vlan)#vtp pruning 六、在SW1上配置vlan2,vlan3。並將Sw1的Port3~port10加入Vlan2。 語法爲:switch(config-if)#switchport mode access Switch(config-if)#swtichport access vlan number 將SW3上的port3~port5加入Vlan3。 7、設置vlan 管理ip及網關 :vlan1—192.168.2.2/24,網關:192.168.2.1 語法爲:switch(config)#interface vlan number Switch(config-if)#ip address ip netmask Switch(config-if)#no shutdown Switch(config)#ip default-gateway ipaddress 八、驗證配置。 Switch#Show vtp status Swtich#Show vlan 九、配置端口安全性。設置Sw1的port3端口最大MAC地址數爲50。 限制Sw1上的port三端口的Pc1 的mac地址只有port1,port2能夠訪問。設置sw3上的port3端口爲保護的。 配置語法: Switch(config-if)#switchport port-security maxmum number Switch(config)# mac-address-table restricted static {mac-address type module/port src-if-list} 例如:switch(config)#mac-address-table restricted static 002d.0124.0254 f0/1 f0/2 //限制f0/1端口的mac 002d.0124.0254只有f0/2端口能夠訪問。 Switch(config-if)#switchport port-security violation protect|restrict|shutdown 十、 啓動http訪問 語法:switch(config)#ip http server//啓動http訪問 Switch(config)#ip http port number //指定端口 |