VLAN설정을 하면 같은 스위치에 물려있더라도 접근할 수 없다.
그래서 VLAN간 연결하기 위해 VLAN간 라우팅 설정하는 것을 Inter-VLAN이라 한다.
ex) VLAN 11 <-> VLAN 12
(스위치 - 글로벌모드)
vlan 11 // 생성
name VLAN_A
int f0/1 // 할당
switchport mode access
switchport access vlan 11
int f0/24 // 트렁크모드
switchport trunk encapsulation dot1q
switchport mode trunk
(라우터 - 글로벌 모드)
int f0/0 // inter-vlan 설정
no shut
int f0/0.11 // 서브 인터페이스1 생성
encapsulation dot1Q 11 // vlan id
ip addr 192.168.11.254 255.255.255.0
int f0/0.12 // 서브 인터페이스2 생성
encapsulation dot1Q 12
ip addr 192.168.12.254 255.255.255.0
(확인)
sh vlan brief
트렁크로 연결된 스위치 간에 VLAN 정보(생성/삭제/수정)를 공유하는 기능
-> VLAN 정보를 각 스위치에 동기화 하기위해 사용
VTP 설정 과정
1) 트렁크 설정
2) VTP Domain 설정
3) VTP Password 설정
4) VTP Mode 설정(Server mode default)
정보 공유 방법
VTP Configuration Revision 값이 높은 스위치쪽의 VLAN 정보로 공유된다.
VTP Configuration Revision 값은 VLAN DB 내용이 변경될때 마다 1씩 증가한다.
VTP 모드
VTP Configuration Revision 초기화 방법
트랜스패런트 모드로 갔다가 서버 모드로 오면 초기화 된다.
트랜스패런트 모드는 정보가 변경되도 VTP Configuration Revision값이 항상 0이기 때문.
VTP Pruning
트렁크 포트로 불필요한 브로드케스트 프레임이 플러딩되는 것을 방지하는 기능을 수행
VTP 설정 명령어
(확인)
sh int trunk
sh vtp status
sh vtp password
sh vlan brief
sh r
(설정)
vtp domain CCNA
vtp password cisco
vtp mode server|transparent|client
=> (해결) 특정 스위치 포트를 논리적으로 차단(Blocking)하는 것 -> STP
이중화과정에서 어떤 스위치 포트를 차단할것인지 자동으로 결정해 차단(브리징 루프 방지)
BPDU 메세지를 이용해 모니터링(장애 발생/복구를 주기적으로 감시)
Disable: 포트가 동작하지 않는 상태
Blocking
Listening
Forwarding: 프레임 송수신이 가능한 상태
Portfast
장애 발생시 딜레이 타임이 최소화.
<VLAN trunk 실습>
(sw1)
-----------------------
no ip domain lookup
hostname sw1
line con 0
logg syn
exec-t 0 0
password ciscocon
login
line vty 0 15
password ciscovty
login
end
enable secret cisco
service password-encryption
int vlan 1
ip addr 192.168.100.1 255.255.255.0
no shut
exit
ip default-gateway 192.168.100.254
vlan 11
name VLAN_A
vlan 12
name VLAN_B
vlan 13
name VLAN_C
int f0/1
switchport mode access
switchport access vlan 11
int f0/2
switchport mode access
switchport access vlan 12
int f0/24
switchport trunk encapsulation dot1q
switchport mode trunk
int f0/10
switchport trunk encapsulation dot1q
switchport mode trunk
end
copy run start
-----------------------------
(sw2)
--------------------------
no ip domain lookup
hostname sw2
line con 0
logg syn
exec-t 0 0
password ciscocon
line vty 0 15
password ciscovty
end
enable secret cisco
service password-encryption
int vlan 1
ip addr 192.168.100.2 255.255.255.0
no shut
exit
ip default-gateway 192.168.100.254
vlan 11
name VLAN_A
vlan 12
name VLAN_B
vlan 13
name VLAN_C
int f0/1
switchport mode access
switchport access vlan 11
int f0/2
switchport mode access
switchport access vlan 12
int f0/3
switchport mode access
switchport access vlan 13
int f0/24
switchport trunk encapsulation dot1q
switchport mode trunk
copy run start
---------------------------------
(r1)
-----------------------------
no ip domain lookup
hostname r1
line con 0
logg syn
exec-t 0 0
password ciscocon
line vty 0 15
password ciscovty
end
enable secret cisco
service password-encryption
int f0/0
ip addr 192.168.100.254 255.255.255.0
no shut
end
wr
int f0/0.11
enacapsulation dot1q 11
ip address 192.168.11.254 255.255.255.0
int f0/0.12
enacapsulation dot1q 12
ip address 192.168.12.254 255.255.255.0
int f0/0.12
enacapsulation dot1q 13
ip address 192.168.13.254 255.255.255.0
----------------------------------
(PC1,2,3,4,5)
--------------------------------
pc 1: 192.168.11.1/24 192.168.11.254
pc 2: 192.168.12.2/24 192.168.12.254
pc 3: 192.168.11.3/24 192.168.11.254
pc 4: 192.168.12.4/24 192.168.12.254
pc 5: 192.168.13.5/24 192.168.13.254
------------------------
(alias 설정)
alias exec r show run
alias exec i sh ip route
.....