Network/GNS
[GNS] VLAN 실습 - 2
쓱은감자
2022. 4. 8. 17:46
후니의 쉽게 쓴 시스코 네트워킹 책 VLAN 실습
실습 구성도
- 스위치 ip
- vtp모드 트랜스패어런트
- vlan 1 - 10.10.10.2/24
- default-gateway - 10.10.10.1
- 라우터 ip
- eth0/0.1 - 10.10.10.1/24
- eth0/0.2 - 10.10.20.1/24
- PC ip
- PC1 - 10.10.10.11/24
- PC2 - 10.10.20.11/24
스위치 설정
- 스위치 관리를 위해 VLAN 1에 IP 주소를 주고 디폴트 게이트웨이 설정
SW1# configure terminal
SW1(config)# interface vlan 1
SW1(config-if)# ip address 10.10.10.2 255.255.255.0
SW1(config-if)# no shutdown
SW1(config-if)# exit
SW1(config)# ip default-gateway 10.10.10.1
- VTP 모드 트랜스페어런트로 설정
SW1# configure terminal
SW1(config)# vtp mode transparent
SW1(config)# vtp domain cisco
SW1(config)# exit
SW1# show vtp status
- vlan 2 생성
SW1# configure terminal
SW1(config)# vlan 2
SW1(config-vlan)# name CCNA
- e0/2 트렁크 포트 설정
SW1# configure terminal
SW1(config)# interface e0/2
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
- e0/1에 VLAN 2 설정
SW1# configure terminal
SW1(config)# interface e0/1
SW1(config-if)# switchport access vlan 2
라우터 설정
- 하나의 인터페이스에서 두 개의 인터페이스가 필요하지만 현재 1개이기 때문에 서브 인터페이스 구성
- VLAN이 2개이기 때문
- 서브 인터페이스 설정
Router# conf t
Router(config)# interface e0/0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# interface Ethernet 0/0.1
Router(config-subif)# encapsulation dot1Q 1 native
Router(config-subif)# ip address 10.10.10.1 255.255.255.0
Router(config-subif)# exit
Router(config)# interface Ethernet 0/0.2
Router(config-subif)# encapsulation dot1Q 2
Router(config-subif)# ip address 10.10.20.1 255.255.255.0
Host IP 설정
- PC1
ip 10.10.1.11 /24 10.10.1.1
- PC2
ip 10.10.2.11 /24 10.10.2.1
연결 확인
- PC1에서 PC2
ping 10.10.20.11
- PC1에서 PC2
ping 10.10.10.11