Risut 2023. 6. 18. 23:07

VTP에 대하여

P. 230

VTP : 자신의 스위치에 설정된 VLAN번호와 이름을 다른 스위치에게 광고하는 프로토콜

------ : VLAN Trunking Protocol

 

VTP 동작 원리

1) 스위치에서 VLAN 정보를 설정한다 . ~> 기본적으로 스위치는 Server이다.

2) 설정 후 스위치에서 VTP 설정 번호를 1 증가시켜 다른 스위치에게 VLAN정보가 담긴 파일과 함께 전송한다

                                    -------------------- : configuration revision             -------------- : vlan.dat 라는 파일에 저장

3) VLAN정보를 받은 스위치는 자신의 VTP 설정번호와 비교한다.

3-1) 자신의 VTP 설정 번호보다  수신한 번호가 더 높으면  vlan.dat파일을 자신의 vlan database에 동기화시킨다.

3-2) 자신의 VTP 설정 번호와 수신한 번호가 같다면 vlan.dat파일을 무시

3-3) 자신의 VTP 설정 번호가 수신한 번호보다 낮다면 자신의 vlan.dat파일을 전송한다. 

 

VTP 동작 모드

1. Server
2. Client
3. Transparent ~> Server 의 vlan.dat 를 동기화 하지 않고 자신의 vlan을 구축
                         ~> Flooding이 생길 수 있다.

 


● 실습

목표

: VTP가 동작하는 원리와 동작 과정을 실습

 

설정

1. inter-vlan 설정

R1)

R1#conf t
R1(config)#int f0/0

R1(config-if)#duplex full

R1(config-if)#no sh
R1(config-if)#int f0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip add 10.1.1.254 255.255.255.0
R1(config-subif)#int f0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip add 20.1.1.254 255.255.255.0
R1(config-subif)#int f0/0.30
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip add 30.1.1.254 255.255.255.0

 

 

2. VTP 설정

Server)

Switch>en
Switch#vlan da
Switch(vlan)#vl 10
VLAN 10 modified:
Switch(vlan)#vl 20
VLAN 20 modified:
Switch(vlan)#vl 30
VLAN 30 added:
    Name: VLAN0030
Switch(vlan)#vtp server
Device mode already VTP SERVER.
Switch(vlan)#vtp domain risut.com
Changing VTP domain name from NULL to risut.com
Switch(vlan)#vtp password cisco
Setting device VTP password to cisco
Switch(vlan)#exit
APPLY completed.
Exiting....

Switch#

 

Transparent)

Switch>en

Switch#vlan da
Switch(vlan)#vtp transparent
Setting device to VTP TRANSPARENT mode..
Switch(vlan)#vtp domain risut.com
Changing VTP domain name from NULL to risut.com
Switch(vlan)#vtp password cisco
Setting device VTP password to cisco
Switch(vlan)#exit
APPLY completed.
Exiting....

Switch#

 

Client)

Switch>en
Switch#vlan da
Switch(vlan)#vtp Client
Setting device to VTP CLIENT mode.
Switch(vlan)#vtp domain risut.com
Changing VTP domain name from NULL to risut.com
Setting device VTP password to cisco
Switch(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
Switch#

 

- 설정값 확인

Server

 

Transtarent

 

Client

 

 

3. Trunk Port 설정

Server)

Switch#conf t
Switch(config)#int g0/0
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#int g1/0
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all

 

Transparent)

Switch#conf t
Switch(config)#int g1/0
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#int g1/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all

 

Client)

Switch#conf t

Switch(config-if)#int g1/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan all

 

결과 확인

Transparent

: Transprent에서는 Server에서 보낸 vlan.dat파일의 정보를 동기화하지 않았다.

Client

: Client에서는 Server에서 보낸 vlan.dat파일의 정보를 자신의 vlan database에 동기화 하여 받은 것을 확인할 수 있다.