본문 바로가기
카테고리 없음

VLAN간의 라우팅(Inter-VLAN Routing)

by 계영수 2024. 2. 2.
728x90

본 포스팅에 대한 강의를 수강할 수 있습니다.

 

보물상자님의 소개 - 인프런 | 온라인 강의 플랫폼

인프런 보물상자님의 소개 페이지 입

 

위와 같은 토폴로지에서 라우터와 스위치 구간의 링크를 물리적인 연결 한 개로 구현하여 보자.

라우터와 스위치 사이의 링크를 트렁크로 구성한다.

 

VLAN간에 트래픽을 전달하기 위해서 라우터와 스위치 사이 구간을 트렁크로 설정할 수 있다. 라우터에는 트렁크 개념이 없기 때문에 Sub Interface를 만들어주어야 한다.

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#no shut
Router(config-if)#int fa0/0.10
Router(config-subif)#encapsulation dot1q ?
  <1-4094>  IEEE 802.1Q VLAN ID
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 10.1.10.1 255.255.255.0
Router(config-subif)#int fa0/0.20
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 10.1.20.1 255.255.255.0
Router(config-subif)#exit
Router(config)#exit
Router#
Router#show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/0        unassigned      YES NVRAM  up                    up 
FastEthernet0/0.10     10.1.10.1       YES manual up                    up 
FastEthernet0/0.20     10.1.20.1       YES manual up                    up 
FastEthernet0/1        unassigned      YES NVRAM  administratively down down 
Vlan1                  unassigned      YES NVRAM  administratively down down
Router#

 

SW01#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
SW01(config)#int gi0/1
SW01(config-if)#switchport mode trunk
SW01(config-if)#exit
SW01(config)#exit
SW01#show int trunk
Port        Mode         Encapsulation  Status        Native vlan
Gig0/1      on           802.1q         trunking      1

Port        Vlans allowed on trunk
Gig0/1      1-1005

Port        Vlans allowed and active in management domain
Gig0/1      1,10,20

Port        Vlans in spanning tree forwarding state and not pruned
Gig0/1      1,10,20

SW01#

 

그렇다면 아예, 라우터와 스위치를 하나의 장비로 구현할 수 있는 방법은 없을까?

728x90