본문 바로가기

IT 엔지니어/네트워크

Inter-VLAN ( 라우터 )

> Inter-Vlan의 목적

 

> 서로 다른 VLAN 사이의 통신을 도와주는 프로토콜

 > VLAN은 논리적으로 브로드캐스트 도메인 영역이 구분되어 있다

 > 즉, 서로 다른 ,VLAN과 통신할 수 없다

 > 라우터 와  L3 스위치 필요하다

    - L2 스위치는 VLAN을 분리 가능

    - 통신을 가능하게 하지는 않는다

 

1.  라우터

  • Router(config-subif)# encapsullation dot1Q 100 200 300 ///// en do 100
  • Router(config-subif)# ip add 172.16.10.1 (VLAN 100 게이트웨이) 255.255.255.0
  • Router(config-subif)#no shut
  • Router(config-subif)#exit

 

2. 스위치

  • Switch(config)#int fa0/24
  • Switch(config-IF)#switchport trunk encapsulation dot1q //// L3 스위치
  • Switch(config-IF)#switchport mode turnk //// L2 스위치
  1. Pc
    • PC IP 및 MAC , SUBNET MASK 주소 지정

 

 

 

 

  1. PC IP 서브넷 마스크 게이트웨이 설정
  2. 스위치에서 VLAN 생성
    1. Switch(config)#vl 100 - 400
  3. 2층 스위치인 각 스위치에서 인터페이스 포트 생성
    1. Switch(config)#int fa0/1
    2. Switch(config-if)#sw mo ac
    3. Switch(config-if)#sw ac vl 100
    4. Switch(config-if)#int fa0/2
    5. Switch(config-if)#sw mo ac
    6. Switch(config-if)#sw ac vl 200
  4. 2층 스위치 트렁킹 =태깅 포인트
    1. Switch(config)#int fa 0/23-24
    2. Switch(config-if)#sw tr en do  /// L3 스위치
    3. Switch(config-if)#sw mo tr /// L2 스위치

 

   5.  L3 스위치(라우터) 트렁킹

      1.  Switch(config)#int fa 0/23-24

      2.  Switch(config)#sw tr en do

      3.  Switch(config)#sw mo tr

 

    6.  L3 스위치(라우터) 가상랜 생성

           1. Switch(config) vl 100 - 400 

 

    7. 가상인터페이스 생성

 

         switch(config)#int vl 100

         switch(config-if)#ip add 172.16.10.1 255.255.255.0

         switch(config)#int vl 200

         switch(config-if)#ip add 172.16.20.1 255.255.255.0

         switch(config)#int vl 300

         switch(config-if)#ip add 172.16.30.1 255.255.255.0

         switch(config)#int vl 400

         switch(config-if)#ip add 172.16.40.1 255.255.255.0

       

    8. 라우팅 활성화

       1. Switch(config)# ip routing

       2. Switch(config)# do sh ip routing

       3. 라우팅 테이블 확인

 

 

 

* 명령어

스페이스바 -> Q : More 넘김

 

Switch(config)#do sh int tr / do sh ip int bri

  • L3 스위치로 포트 변경( 미변경 시 L2 스위치 포트)
  • Switch(config-if)#ip routing /////        라우터의 경우, 물리적 랜과 가상적 랜 모두 사용 가능
  • Switch(config)#int fa0/1
  • Switch(config-if)#ip add 192.168.10.1 255.255.255.0 - x
    • Switch(config-if)#no swi no switch
  • Switch(config-if)#ip add 192.168.10.1 255.255.255.0
  • Switch(config-if)#ip routing
    • Switch(config)#do sh ip ro

 

 

* L2스위치 → L3 스위치 변경 필요하다

 

Switch(config)#int fa0/24

Switch(config-if)#int fa0/24. //// 라우터 설정

100 % Only routers can have sub interfaces in this version.

 

 

  • L2 스위치에서 가상랜 생성 시 가상 랜 내부에서만 통신 가능
  • L3 스위치에서 가상랜 생성 가능

'IT 엔지니어 > 네트워크' 카테고리의 다른 글

EthernetChannel  (0) 2025.01.13
Inter-VLAN 마무리 실습 그리고 VTP  (0) 2025.01.12
VLAN( Virtual Local Area Network) 생성 순서  (0) 2025.01.09
Switch -1  (0) 2025.01.08
패킷 트레이서 명령어  (0) 2025.01.07