Contents

Native VLAN, L3 Switch

   Feb 14, 2023     6 min read

Ex. VLAN

Untitled

방법

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



결과

Untitled (1)

Untitled (2)

Untitled (3)

PC끼리 모두 통신이 되면 된다.


Untitled (4)

Untitled (5)
trunk가 2개 생긴 것을 볼 수 있다.

Untitled (6)

Untitled (7)

Untitled (8)
trunk가 1개 생긴 것을 볼 수 있다.


Native VLAN 특징 01

  • Native VLAN : Tag를 붙이고 지우고를 하지 않는 것. -> 바로 가는 것.
  • Tag x = Native VLAN = Switch 1당 1개

스위치는 기본적으로 들어올 때, VLAN 번호를 붙이고 나갈 때 VLAN 번호를 제거한다.



Ex.01

Untitled (9)

Untitled (10)
ping이 된다.

Untitled (11)

Ex.02

Untitled (12)

Untitled (13)
ping이 된다.

Untitled (14)

Ex.03

Untitled (15)

Untitled (16)
ping이 되지 않는다.

Untitled (17)

VLAN 20구간에서 충돌이 발생해서 ping이 되지 않는다.


참고

Trunk mode는 그대로 가지고 간다.


Native VLAN 특징 02

Untitled (18)

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 확인하는 방법
    Untitled (19)
    #show int trunk

Native VLAN 특징 03

Native VLAN은 VLAN번호를 표시하지 않는 VLAN이다.
(기본 Native VLAN 번호는 1)



Untitled (20)

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 해 줘야함.



결과

Untitled (21)

Untitled (22)

Untitled (23)

모두 ping이 되면 된다.

Untitled (24)

S5
Untitled (25)


L3 Switch

  • L3 Switch - Multilayer

Ex.

Untitled (26)

방법

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



결과

Untitled (27)

VPC8에서 ping 192.168.20.1 이 되면 된다.

Untitled (28)

Untitled (29)


L3 Switch Ex.

Untitled (30)

명령어

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하면 됨.

Untitled (31)