본문 바로가기

CCNA 기초

VLAN과 Trunk 기본 설정

다음과 같이 네트워크를 구성해서 VLAN 끼리 통신이 가능하도록 하시오.

각 PC의 IP할당 : 10.1.1.X
VLAN 은 3개로 분류




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

Switch 0 설정

Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 10 name VLAN1
VLAN 10 modified:
    Name: VLAN1
Switch(vlan)#vlan 20 name VLAN2
VLAN 20 added:
    Name: VLAN2
Switch(vlan)#vlan 30 name VLAN3
VLAN 30 added:
    Name: VLAN3
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#show vlan br



Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fa 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface fa 0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface range fa 0/4 - 5
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 30
Switch(config-if-range)#exit
Switch(config)#end

%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan br

Switch#

Switch 1 설정

Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 10 name VLAN1
VLAN 10 added:
    Name: VLAN1
Switch(vlan)#vlan 20 name VLAN2
VLAN 20 added:
    Name: VLAN2
Switch(vlan)#vlan 30 name VLAN3
VLAN 30 added:
    Name: VLAN3
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#show vlan br



Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fa 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan1

                                        ^
% Invalid input detected at '^' marker.
 
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface fa 0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface range fa 0/4 - 5
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 30
Switch(config-if-range)#exit
Switch(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan br

Switch#

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

트렁크 설정
 - 두개의 Switch중 한쪽만 해주면 되고,  Switch와 Switch가 연결된 포트만 설정해 주면 된다.

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fa 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#end

%SYS-5-CONFIG_I: Configured from console by console

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

설정 확인
- VLAN으로 묶인 PC만 통신이 된다. 

같은 VLAN으로 묶인 PC test (10.1.1.2 + 10.1.1.6)
PC>ping 10.1.1.6

Pinging 10.1.1.6 with 32 bytes of data:

Reply from 10.1.1.6: bytes=32 time=156ms TTL=128
Reply from 10.1.1.6: bytes=32 time=94ms TTL=128
Reply from 10.1.1.6: bytes=32 time=94ms TTL=128
Reply from 10.1.1.6: bytes=32 time=78ms TTL=128

Ping statistics for 10.1.1.6:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 78ms, Maximum = 156ms, Average = 105ms

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

같은 VLAN으로 묶인 PC test (10.1.1.2 + 10.1.1.7)
PC>ping 10.1.1.7

Pinging 10.1.1.7 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.1.1.7:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),