精品福利视频一区二区三区,免费A级毛片无码无遮挡,偷窥目拍性综合图区,亚洲欧洲无码AV电影在线观看,超清无码熟妇人妻AV在线电影

認證培訓,h3c認證體系,網(wǎng)絡(luò )工程師
豐沃創(chuàng  )新

虛擬局域網(wǎng)(VLAN)

  • 發(fā)布時(shí)間: 2018-5-3 10:15:53

配置VTP

所有的交換機,在默認時(shí)都配置為VTP服務(wù)器。要配置VTP,首先必須配置你想要使用的VTP域名。在創(chuàng )建VTP域時(shí),有一些選項,包括設置域名、口令、操作模式和交換機的修建功能?墒褂肰TP全局配置模式命令來(lái)設置所有這些信息。在下面的列茲中,我將交換機設置為VTP server,將VTP域名設置為Cisco,將VTP口令設置為12345:

  1. 1900(config)#vtp server  
  2.  
  3. 1900(config)#vtp domain Cisco  
  4.  
  5. 1900(config)#vtp password 12345 

默認時(shí)所有的交換機都設置為VTP服務(wù)器模式,如果想在交換機上改動(dòng)任何有關(guān)VLAN的信息,都必須在VTP服務(wù)器模式下進(jìn)行。

在2950交換機上配置VTP,同樣要首先配置想要使用的域名。同樣,一旦在交換機上配置了VTP信息,就需要驗證它?墒褂肰TP全局配置模式命令來(lái)設置這些信息。例子中,把交換機設置為服務(wù)器模式,域名設置為SZ_Lab

  1. Switch(config)#vtp mode server  
  2.  
  3. Switch(config)#vtp domain SZ_Lab 

配置示例互聯(lián)網(wǎng)絡(luò )中的交換

先配置2950C,如下:

  1. 2950C(config)#enable secret noko  
  2.  
  3. 2950C(config)#line con 0  
  4.  
  5. 2950C(config-line)#login  
  6.  
  7. 2950C(config-line)#password noco  
  8.  
  9. 2950C(config-line)#line vty 0 15  
  10.  
  11. 2950C(config-line)#login  
  12.  
  13. 2950C(config-line)#password noco  
  14.  
  15. 2950C(config-line)#banner motd #  
  16.  
  17. 2950C  
  18.  
  19. #  
  20.  
  21. 2950C(config-line)#exit  
  22.  
  23. 2950C(config)#int vlan1  
  24.  
  25. 2950C(config-if)#ip address 172.16.10.2 255.255.255.0  
  26.  
  27. 2950C(config-if)#no shut  
  28.  
  29. 2950C(config-if)#exit  
  30.  
  31. 2950C(config)#up default-gateway 172.16.10.1  
  32.  
  33. 2950C(config)#^Z  
  34.  
  35. 2950C#copy run start 

配置2950B,如下:

  1. 2950B(config)#enable secret noko  
  2.  
  3. 2950B(config)#line con 0  
  4.  
  5. 2950B(config-line)#login  
  6.  
  7. 2950B(config-line)#password noco  
  8.  
  9. 2950B(config-line)#line vty 0 15  
  10.  
  11. 2950B(config-line)#login  
  12.  
  13. 2950B(config-line)#password noco  
  14.  
  15. 2950B(config-line)#banner motd #  
  16.  
  17. 2950B  
  18.  
  19. #  
  20.  
  21. 2950B(config-line)#exit  
  22.  
  23. 2950B(config)#int vlan1  
  24.  
  25. 2950B(config-if)#ip address 172.16.10.3 255.255.255.0  
  26.  
  27. 2950B(config-if)#no shut  
  28.  
  29. 2950B(config-if)#exit  
  30.  
  31. 2950B(config)#up default-gateway 172.16.10.1  
  32.  
  33. 2950B(config)#^Z  
  34.  
  35. 2950B#copy run start 

配置trunk,2950B如下:

  1. 2950B(config)#int f0/1  
  2.  
  3. 2950B(config-if)#switchport mode trunk  
  4.  
  5. 2950B(config-if)#int f0/4  
  6.  
  7. 2950B(config-if)#switchport mode trunk  
  8.  
  9. 2950B(config-if)#int f0/5  
  10.  
  11. 2950B(confgi-if)#switchport mode trunk 

配置trunk,2950C如下:

  1. 2950C(config)#int f0/4  
  2.  
  3. 2950C(confgi-if)#switchport mode trunk  
  4.  
  5. 2950C(config-if)#int f0/5  
  6.  
  7. 2950C(config-if)#switchport mode trunk 

驗證trunk信息,使用show interface trunk命令.如下:

  1. 2950B#sh int trunk  
  2.  
  3. Port Mode Encapsulation Status Native vlan  
  4.  
  5. Fa0/1 on 802.1q trunking 1  
  6.  
  7. Fa0/4 on 802.1q trunking 1  
  8.  
  9. Fa0/5 on 802.1q trunking 1  
  10.  
  11. (略) 

之前我們已經(jīng)對2950B和2950C做了基本配置和trunk端口的配置,接下來(lái)應該設置VTP和創(chuàng )建VLAN,并且進(jìn)行驗證.2950C如下:

  1. 2950C(config)#vtp mode server  
  2.  
  3. 2950C(config)#vtp domain Cisco  
  4.  
  5. 2950C(config)#^Z  
  6.  
  7. 2950C#vlan database  
  8.  
  9. 2950C(vlan)#vlan 2 name sales  
  10.  
  11. 2950C(vlan)#vlan 3 name marketing  
  12.  
  13. 2950C(vlan)#apply  
  14.  
  15. 2950C(vlan)#^C  
  16.  
  17. 2950C#sh vlan brief  
  18.  
  19. (略) 

接下來(lái)分配端口,把Fa0/2分配給VLAN2,Fa0/3分配給VLAN3,默認所有的端口都處在VLAN1下,配置如下:

  1. 2950C(config)#int fa0/2  
  2.  
  3. 2950C(config-if)#switchport access vlan2  
  4.  
  5. 2950C(config)#int fa0/3  
  6.  
  7. 2950C(config-if)#switchport access vlan3 

驗證信息,注意VLAN1里的Ports欄,如下:

  1. 2950C#sh vlan brief  
  2.  
  3. VLAN Name Status Ports  
  4.  
  5. ----------------------------------------------------------------------------  
  6.  
  7. 1 default active Fa0/1 Fa0/5...Fa0/10  
  8.  
  9. 2 sales active Fa0/2  
  10.  
  11. 3 marketing active Fa0/3 

配置2950B,把它設置成客戶(hù)模式,2950B從2950C接收VLAN信息,如下:

  1. 2950B(config)#vtp mode client  
  2.  
  3. 2950B(config)#vtp domain Cisco  
  4.  
  5. 2950B(config)#^Z 

驗證,注意2950B已經(jīng)從2950C知道了VLAN的信息,如下:

  1. 2950B#sh vlan brief  
  2.  
  3. VLAN Name Status Ports  
  4.  
  5. ----------------------------------------------------------------------------  
  6.  
  7. 1 default active Fa0/1...Fa0/12  
  8.  
  9. 2 sales active  
  10.  
  11. 3 marketing active 

但是仍然要給2950B分配端口,如下:

  1. 2950B(config)#int fa0/2  
  2.  
  3. 2950B(config-if)#switchport access vlan2  
  4.  
  5. 2950B(config)#int fa0/3  
  6.  
  7. 2950B(config-if)#switchport access vlan3 

驗證信息,如下:

  1. VLAN Name Status Ports  
  2.  
  3. ----------------------------------------------------------------------------  
  4.  
  5. 1 default active Fa0/1 Fa0/5...Fa0/12  
  6.  
  7. 2 sales active Fa0/2  
  8.  
  9. 3 marketing active Fa0/3 

到現在,2950C和2950B的配置就算是完成了,經(jīng)過(guò)驗證,我們也沒(méi)發(fā)現什么問(wèn)題,接下來(lái)該配置什么呢?當然是配置VLAN間的通信,根據上面的拓撲圖,可以知道需要在RouterB上進(jìn)行配置,如下:

  1. RouterB(config)#hostname Trunkrouter  
  2.  
  3. Trunkrouter(config)#int f0/0  
  4.  
  5. Trunkrouter(config-if)#no ip address  
  6.  
  7. Trunkrouter(config-if)#no shut 

創(chuàng )建子接口,并定義封裝類(lèi)型,如下:

  1. Trunkrouter(config-if)#int f0/0.1  
  2.  
  3. Trunkrouter(config-subif)#encapsulation dot1q 1  
  4.  
  5. Trunkrouter(config-subif)#ip address 172.16.10.1 255.255.255.0  
  6.  
  7. Trunkrouter(config-if)#int f0/0.2  
  8.  
  9. Trunkrouter(config-subif)#encapsulation dot1q 2  
  10.  
  11. Trunkrouter(config-subif)#ip address 172.16.20.1 255.255.255.0  
  12.  
  13. Trunkrouter(config-if)#int f0/0.3  
  14.  
  15. Trunkrouter(config-subif)#encapsulation dot1q 3  
  16.  
  17. Trunkrouter(config-subif)#ip address 172.16.30.1 255.255.255.0  
  18.  
  19. Trunkrouter(config-if)#exit 

創(chuàng )建子接口,每個(gè)接口對應1個(gè)VLAN.注意,如果你試圖在第一個(gè)子接口分配IP地址,將收到錯誤信息,除非你先定義了封裝類(lèi)型,如下:

  1. Trunkrouter(config-if)#int f0/0.1  
  2.  
  3. Trunkrouter(config-subif)#ip address 172.16.10.1 255.255.255.0  
  4.  
  5. Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL VLAN. 
精品福利视频一区二区三区,免费A级毛片无码无遮挡,偷窥目拍性综合图区,亚洲欧洲无码AV电影在线观看,超清无码熟妇人妻AV在线电影