티스토리 뷰

1. 스위치에서는 Native vlan을 10번으로 잡고 라우터의 주인터페이스를 Native vlan으로 이용한다.

[SW1]

conf t
 vlan 10
  exit
 vlan 20
  exit
 int f1/1
  switchport mode access
  switchport access vlan 10
  exit
 int f1/2
  switchport mode access
  switchport access vlan 20
  exit
 int f1/9
  switchport trunk encapsulation dot1q
  switchport trunk native vlan 10
  switchport mode trunk

  exit

 

[R1]

conf t
 int f0/0
  no sh
  ip add 192.168.10.254 255.255.255.0
  exit
 int f0/0.20
  ip add 192.168.20.254 255.255.255.0
  encapsulation dot1q 20

 

[PC1]
conf t
 no ip routing
 ip default-gateway 192.168.10.254
 int f0/0
   no sh
   ip add 192.168.10.1 255.255.255.0
   exit

PC2]
conf t
 no ip routing
 ip default-gateway 192.168.20.254
 int f0/0
   no sh
   ip add 192.168.20.2 255.255.255.0
   exit

 

----------------------------------------------------------------

2. 라우터의 서브인터페이스 중 하나를 Native vlan으로 이용

[R1]
int f0/0
 no ip add
 exit
int f0/0.10
 encapsulation dot1q 10 native
 ip add 192.168.10.254 255.255.255.0
 exit
do wr

 

[SW1]

int f1/9
 switchport trunk native vlan 10
 switchport mode trunk

 

----------------------------------------------------------------

3. 모든 서브 vlan에 각각 태그를 달고 통신한다.

[R1]
conf t
int f0/0.10
 no encapsulation dot1q 10 native
 encapsulation dot1q 10
 ip add 192.168.10.254 255.255.255.0
 exit
int f0/0.20
 encapsulation dot1q 20
 ip add 192.168.20.254 255.255.255.0
 exit

do wr

[SW1]
conf t
int f1/9
 no switchport trunk native vlan 10

 

----------------------------------------------------------------

SVI (가상(논리) 스위치 인터페이스)

[SW1]
conf t
vlan 12
 name VLAN12
 exit
int f1/1
 switchport mode access
 switchport access vlan 12
 exit
int lo0
 ip add 192.168.1.1 255.255.255.0
 exit
int vlan 12
 ip add 192.168.12.1 255.255.255.0
 exit
ip route 192.168.2.0 255.255.255.0 vlan12 192.168.12.2
ip route 192.168.3.0 255.255.255.0 vlan12 192.168.12.2
ip route 192.168.23.0 255.255.255.0 vlan12 192.168.12.2

------------>축약

ip route 192.168.0.0 255.255.224.0 vlan12 192.168.12.2



[SW2]
conf t
vlan 12
 name VLAN12
 exit
vlan 23
 name VLAN23
 exit
int f1/2
 switchport mode access
 switchport access vlan 12
 exit
int f1/3
 switchport mode access
 switchport access vlan 23
 exit
int lo0
 ip add 192.168.2.2 255.255.255.0
 exit
int vlan 12
 ip add 192.168.12.2 255.255.255.0
 exit
int vlan 23
 ip add 192.168.23.2 255.255.255.0
 exit
ip route 192.168.1.0 255.255.255.0 vlan12 192.168.12.1
ip route 192.168.3.0 255.255.255.0 vlan23 192.168.23.3

[SW3]
conf t
vlan 23
 name VLAN23
 exit
int f1/3
 switchport mode access
 switchport access vlan 23
 exit
int lo0
 ip add 192.168.3.3 255.255.255.0
 exit
int vlan 23
 ip add 192.168.23.3 255.255.255.0
 exit
ip route 192.168.1.0 255.255.255.0 vlan23 192.168.23.2
ip route 192.168.2.0 255.255.255.0 vlan23 192.168.23.2
ip route 192.168.12.0 255.255.255.0 vlan23 192.168.23.2

------------>축약

ip route 192.168.0.0 255.255.240.0 vlan23 192.168.23.2

 

-------------------------------------------------------------------------------

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함