16¡¢STP¼òµ¥¸ºÔؾùºâʵÑé
ͼ16-1
ÔÚÉÏͼ16-1ÖУ¬SW0µÄfa0/1Á¬½ÓÁËSW1µÄfa0/2£¬SW1µÄfa0/1Á¬½ÓÁËSW0µÄfa0/2£¬ÕâÁ½ÌõÁ´Â·±»ÅäÖóÉÖ÷¸É£¬½«SW0ÉèÖóÉVTP Server£¬SW1ÉèÖóÉVTP Client£¬ÔÚSW0ÉÏн¨VLAN2£¬ÈÃSW0³ÉΪVLAN1µÄ¸ù½»»»»ú£¬SW1³ÉΪVLAN2µÄ¸ù½»»»»ú£¬ÕâÑù¸ù¾ÝÇ°ÃæµÄÐðÊö£¬ÔÚVLAN1Éú³ÉÊ÷ʵÀýÖÐSW1µÄfa0/1½Ó¿Ú½«±»×èÈû£¬VLAN1µÄÁ÷Á¿½«È«²¿´ÓÉÏÃæÄÇÌõÏß·¾¹ý£¬¶øÔÚVLAN2Éú³ÉÊ÷ʵÀýÖÐSW1µÄfa0/1½«±»×èÈû£¬VLAN2µÄÁ÷Á¿½«È«²¿´ÓÏÂÃæÕâÌõÏß·×ß¡£ÃüÁîÅäÖÃÈçÏÂ
Ê×ÏȽ«SW0ºÍSW1ÏàÁ¬µÄÁ½ÌõÏß·ÅäÖóÉÖ÷¸É SW0(config)#interface fastEthernet 0/1 SW0(config-if)#switchport mode trunk SW0(config-if)#exit
SW0(config)#interface fastEthernet 0/2 SW0(config-if)#switchport mode trunk SW0(config-if)#exit
SW1(config)#interface fastEthernet 0/1 SW1(config-if)#switchport mode trunk SW1(config-if)#exit
SW1(config)#interface fastEthernet 0/2 SW1(config-if)#switchport mode trunk SW1(config-if)#exit
½«SW0ÉèÖÃΪVTP Server²¢´´½¨VLAN2£¬½«SW1ÉèÖÃΪVTP Client SW0#vlan database
SW0(vlan)#vtp domain ccna //ÉèÖÃvtpÓòÃû Changing VTP domain name from NULL to ccna SW0(vlan)#vtp password ccna //ÉèÖÃvtp¿ÚÁî Setting device VLAN database password to ccna. SW0(vlan)#vtp server //ÉèÖÃΪvtp·þÎñ¶Ë Device mode already VTP SERVER.
SW0(vlan)#vlan 2 //´´½¨vlan 2 SW0(vlan)#exit
SW1#vlan database
SW1(vlan)#vtp domain ccna //ÉèÖÃvtpÓòÃû
Domain name already set to ccna .
SW1(vlan)#vtp password ccna //ÉèÖÃvtp¿ÚÁî Setting device VLAN database password to ccna. SW1(vlan)#vtp client //ÉèÖÃΪvtp¿Í»§¶Ë Setting device to VTP CLIENT mode. SW1(vlan)#exit
17¡¢VTP¼ò½é
VTP£¨VLAN Trunking Protocol£©£ºÊÇVLANÖмÌÐÒ飬Ҳ±»³ÆΪÐéÄâ¾ÖÓòÍø¸ÉµÀÐÒé¡£ËüÊÇ˼¿Æ˽ÓÐÐÒé¡£×÷ÓÃÊÇÊ®¼¸Ì¨½»»»»úÔÚÆóÒµÍøÖУ¬ÅäÖÃVLAN¹¤×÷Á¿´ó£¬¿ÉÒÔʹÓÃVTPÐÒ飬°Ñһ̨½»»»»úÅäÖóÉVTP Server, ÆäÓཻ»»»úÅäÖóÉVTP Client,ÕâÑùËûÃÇ¿ÉÒÔ×Ô¶¯Ñ§Ï°µ½Server ÉϵÄVLAN ÐÅÏ¢¡£
ËüÊÇÒ»¸öOSI²Î¿¼Ä£Ð͵ڶþ²ãµÄͨÐÅÐÒ飬Ö÷ÒªÓÃÓÚ¹ÜÀíÔÚͬһ¸öÓòµÄÍøÂ緶ΧÄÚVLANsµÄ½¨Á¢¡¢É¾³ýºÍÖØÃüÃû¡£ÔÚһ̨VTP Server ÉÏÅäÖÃÒ»¸öеÄVLANʱ£¬¸ÃVLANµÄÅäÖÃÐÅÏ¢½«×Ô¶¯´«²¥µ½±¾ÓòÄÚµÄÆäËûËùÓн»»»»ú¡£ÕâЩ½»»»»ú»á×Ô¶¯µØ½ÓÊÕÕâЩÅäÖÃÐÅÏ¢£¬Ê¹ÆäVLANµÄÅäÖÃÓëVTP Server±£³ÖÒ»Ö£¬´Ó¶ø¼õÉÙÔÚ¶ą̀É豸ÉÏÅäÖÃͬһ¸öVLANÐÅÏ¢µÄ¹¤×÷Á¿£¬¶øÇÒ±£³ÖÁËVLANÅäÖõÄͳһÐÔ¡£