Native VLAN, L3 Switch
Ex. VLAN
방법
S5
no ip routing
vlan 10
vlan 20
Gi0/0
switchport trunk encapsulation dot1q
switchport mode trunk
Gi0/1
switchport trunk encapsulation dot1q
switchport mode trunk
Gi1/0
switchport mode access
switchport access vlan 10
Gi1/1
switchport mode access
switchport access vlan 20
S6
no ip routing
vlan 10
vlan 20
Gi0/0
switchport trunk encapsulation dot1q
switchport mode trunk
Gi0/1
switchport mode access
switchport access vlan 10
Gi0/2
switchport mode access
switchport access vlan 20
S7
no ip routing
vlan 30
Gi0/0
switchport mode access
switchport access vlan 30
Gi0/1
switchport mode access
switchport access vlan 30
S8
no ip routing
vlan 10
vlan 20
vlan 30
Gi0/0
switchport trunk encapsulation dot1q
switchport mode trunk
Gi0/1
switchport mode access
switchport access vlan 10
Gi0/2
switchport mode access
switchport access vlan 20
Gi0/3
switchport mode access
switchport access vlan 30
vIOS1
int Gi0/1
no shutdown
int g0/1.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
int g0/1.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
vIOS4
int Gi0/1
no shutdown
int g0/1.10
encapsulation dot1Q 10
ip address 192.168.40.254 255.255.255.0
int g0/1.20
encapsulation dot1Q 20
ip address 192.168.50.254 255.255.255.0
int g0/1.30
encapsulation dot1Q 30
ip address 192.168.60.254 255.255.255.0
결과
PC끼리 모두 통신이 되면 된다.
trunk가 2개 생긴 것을 볼 수 있다.
trunk가 1개 생긴 것을 볼 수 있다.
Native VLAN 특징 01
- Native VLAN : Tag를 붙이고 지우고를 하지 않는 것. -> 바로 가는 것.
- Tag x =
Native VLAN
= Switch 1당 1개
스위치는 기본적으로 들어올 때, VLAN 번호를 붙이고 나갈 때 VLAN 번호를 제거한다.
Ex.01
ping이 된다.
Ex.02
ping이 된다.
Ex.03
ping이 되지 않는다.
VLAN 20구간에서 충돌이 발생해서 ping이 되지 않는다.
참고
Trunk mode
는 그대로 가지고 간다.
Native VLAN 특징 02
Native VLAN은 untagged 형태로 전송된다.
Native VLAN은 Switch당 1개만 존재한다.
결과
PC 1.1.1.1
> ping 1.1.1.2 - O
> ping 1.1.1.3 - X
> ping 1.1.1.4 - X
PC 1.1.1.3
> ping 1.1.1.4 - O
> ping 1.1.1.5 - O
참고
- Native VLAN 확인하는 방법
#show int trunk
Native VLAN 특징 03
Native VLAN은 VLAN번호를 표시하지 않는 VLAN이다.
(기본 Native VLAN 번호는 1)
Native VLAN 변경 방법 - 유형 01
Native VLAN 10
int g0/0
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk native vlan 10
Native VLAN 변경 방법 - 유형 02
Native VLAN 30
int g0/0.30
encapsulation dot1q **30 native**
ip address 192.168.30.254 255.255.255.0
S4
Gi0/0 → Native VLAN 해 줘야함.
S5
Gi0/0 → Native VLAN 해 줘야함.
결과
모두 ping이 되면 된다.
S5
L3 Switch
- L3 Switch - Multilayer
Ex.
방법
S1
ip routing
interface Gi0/0
no switchport
ip address 192.168.10.2 255.255.255.0
interface Gi0/1
no switchport
ip address 1.1.12.1 255.255.255.0
S2
ip routing
interface Gi0/1
no switchport
ip address 192.168.20.2 255.255.255.0
interface Gi0/0
no switchport
ip address 1.1.12.2 255.255.255.0
VPC8
ip 192.168.10.1/24 192.168.10.2
save
show ip
VPC9
ip 192.168.20.1/24 192.168.20.2
save
show ip
결과
VPC8에서 ping 192.168.20.1 이 되면 된다.
L3 Switch Ex.
명령어
S4
no ip routing
interface Gi0/1
switchport mode access
switchport access vlan 10
interface Gi0/2
switchport mode access
switchport access vlan 20
interface Gi0/0
switchport trunk encapsulation dot1Q
switchport mode trunk
S3
ip routing
interface Gi0/0
switchport trunk encapsulation dot1Q
switchport mode trunk
vlan 10
interface vlan 10
ip address 192.168.10.2 255.255.255.0
no shutdown
vlan 20
interface vlan 20
ip address 192.168.20.2 255.255.255.0
no shutdown
결과
10.1 PC에서 ping 192.168.20.1하면 됨.