코인데일리넷

가상화폐 / NFT / 경제

기타/1

[DAY29] VLAN , 트렁킹 실습예제

코인데일리넷 매니저 2021. 11. 3. 23:28

SW 기본 세팅

 

Switch(config)#hostname S1

 

S1(config)#enable secret class

S1(config)#no ip domain-lookup

 

S1(config)#ip default-gateway 172.17.99.1

 

S1(config)#line console 0

S1(config-line)#password cisco

S1(config-line)#login

 

S1(config-line)#line vty 0 15

S1(config-line)#password cisco

S1(config-line)#login

S1(config-line)#end

S1#copy running-config startup-config

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

VLAN 설정

 

S1(config)#vlan 99

S1(config-vlan)#name management

S1(config)#vlan 10

S1(config-vlan)#name faculty-staff

S1(config)#vlan 20

S1(config-vlan)#name students

S1(config)#vlan 30

S1(config-vlan)#name guest

S1(config-vlan)#end

 

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

VLAN 할당

 

액세스 모드 ( S2 에서만)

S2(config)#interface fa0/6

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 30

S2(config-if)#no shutdown

 

S2(config-if)#interface fa0/11

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 10

S2(config-if)#no shutdown

 

S2(config-if)#interface fa0/18

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 20

S2(config-if)#no shutdown

 

트렁크 모드 (모든 스위치 동일)

S1(config)#interface range fa0/1-5

S1(config-if-range)#switchport mode trunk

S1(config-if-range)#switchport trunk native vlan 99

S1(config-if-range)#no shutdown

S1(config)#end

 

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

인터페이스 주소 설정

 

S1(config)#interface vlan 99

S1(config-if)#ip address 172.17.99.11 255.255.255.0

 

S2(config)#interface vlan 99

S2(config-if)#ip address 172.17.99.12 255.255.255.0

 

S3(config)#interface vlan 99

S3(config-if)#ip address 172.17.99.13 255.255.255.0

 

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

VTP 설정 변경

 

S1(config)#vtp mode server

Device mode already VTP SERVER.

S1(config)#vtp domain Lab6

Changing VTP domain name from NULL to Lab6

S1(config)#vtp password cisco

Setting device VLAN database password to cisco

S1(config)#end

 

S2(config)#vtp mode client

Setting device to VTP CLIENT mode

S2(config)#vtp domain Lab6

Changing VTP domain name from NULL to Lab6

S2(config)#vtp password cisco

Setting device VLAN database password to cisco

S2(config)#end

 

S3(config)#vtp mode client

Setting device to VTP CLIENT mode

S3(config)#vtp domain Lab6

Changing VTP domain name from NULL to Lab6

S3(config)#vtp password cisco

Setting device VLAN database password to cisco

S3(config)#end

 

---------

라우터

 

R1(config)#interface fastethernet 0/0

R1(config-if)#no shutdown

 

R1(config-if)#interface fastethernet 0/0.1

R1(config-subif)#encapsulation dot1q 1

R1(config-subif)#ip address 172.17.1.1 255.255.255.0

 

R1(config-if)#interface fastethernet 0/0.10

R1(config-subif)#encapsulation dot1q 10

R1(config-subif)#ip address 172.17.10.1 255.255.255.0

 

R1(config-if)#interface fastethernet 0/0.20

R1(config-subif)#encapsulation dot1q 20

R1(config-subif)#ip address 172.17.20.1 255.255.255.0

 

R1(config-if)#interface fastethernet 0/0.30

R1(config-subif)#encapsulation dot1q 30

R1(config-subif)#ip address 172.17.30.1 255.255.255.0

 

R1(config-if)#interface fastethernet 0/0.99

R1(config-subif)#encapsulation dot1q 99 native

R1(config-subif)#ip address 172.17.99.1 255.255.255.0

 

R1(config)#interface FastEthernet0/1

R1(config-if)#ip address 172.17.50.1 255.255.255.0

R1(config-if)#description server interface

R1(config-if)#no shutdown

R1(config-if)#end