반응형
    
    
    
  Cisco 스위치에서 VLAN 및 트렁크 설정하는 방법
1. VLAN 생성 및 인터페이스 설정
enable
configure terminal
vlan 200
end
이 명령어는 VLAN 200을 생성합니다.
2. VLAN 인터페이스 설정 및 IP 주소 할당
configure terminal
interface vlan 200
ip address 218.234.13.20 255.255.255.0
no shutdown
end
이 명령어는 VLAN 200에 IP 주소를 할당하고 인터페이스를 활성화합니다.
3. Access 포트 설정
configure terminal
interface fastEthernet 0/4
switchport mode access
switchport access vlan 200
end
이 명령어는 FastEthernet 0/4 인터페이스를 VLAN 200의 Access 포트로 설정합니다.
4. 트렁크 포트 설정
configure terminal
interface fastEthernet 0/24
switchport mode trunk
end
이 명령어는 FastEthernet 0/24 인터페이스를 트렁크 포트로 설정합니다.
5. 종료 및 설정 저장
end
write memory
변경 사항을 저장하여 설정을 영구적으로 유지합니다.
6. 트렁크 설정 확인
show interfaces fastEthernet 0/24 switchport
트렁크 설정을 확인합니다.
7. 트렁크 상태 확인
show interfaces trunk
트렁크 인터페이스의 상태를 확인합니다.
Vlan 설정
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface vlan 1
Switch(config-if)#ip address 218.234.13.20 255.255.255.0
Switch(config-if)#no shutdown
%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active  
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1     enet  100001     1500  -      -      -        -    -        0      0
1002 enet  101002     1500  -      -      -        -    -        0      0
1003 enet  101003     1500  -      -      -        -    -        0      0
1004 enet  101004     1500  -      -      -        -    -        0      0
1005 enet  101005     1500  -      -      -        -    -        0      0
Switch#show running-config
Building configuration...
Current configuration : 940 bytes
!
version 12.1
no service password-encryption
!
hostname Switch
!
!
!
interface Vlan1
 ip address 218.234.13.20 255.255.255.0
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
end
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 200
Switch(config-vlan)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
200  VLAN0200                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active   
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
200  enet  100200     1500  -      -      -        -    -        0      0
1002 enet  101002     1500  -      -      -        -    -        0      0
1003 enet  101003     1500  -      -      -        -    -        0      0
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fastEthernet 0/04
Switch(config-if)#switchport access vlan 200
Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Gig1/1
                                                Gig1/2
200  VLAN0200                         active    Fa0/24
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active  
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
200  enet  100200     1500  -      -      -        -    -        0      0
1002 enet  101002     1500  -      -      -        -    -        0      0
1003 enet  101003     1500  -      -      -        -    -        0      0
1004 enet  101004     1500  -      -      -        -    -        0      0
1005 enet  101005     1500  -      -      -        -    -        0      0
Switch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Trunk 설정
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
스위치와 스위치 연결 포트
Switch(config)#interface fastEthernet 0/24
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Switch#disable
Switch>show interfaces fastEthernet 0/24 switchPort
Name: Fa0/24
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 200 (VLAN0200)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none
Switch>
Trunk 확인
Switch#show interfaces trunk
Port        Mode         Encapsulation  Status        Native vlan
Fa0/24      on           802.1q         trunking      1
위의 명령어 시퀀스는 VLAN 200을 생성하고 인터페이스를 설정한 후 Access 포트와 트렁크 포트를 구성하는 데 사용됩니다. 설정이 변경되었으므로 변경 사항을 저장해야 합니다. Cisco 스위치 및 운영 체제 버전에 따라 명령어가 다를 수 있으므로 사용 중인 스위치 모델과 운영 체제에 따라 해당 버전의 공식 문서를 참조하는 것이 좋습니다.
728x90
    
    
  반응형
    
    
    
  '네트워크' 카테고리의 다른 글
| [router] 라우팅 테이블 및 네트워크 인터페이스 관련 정보를 확인하기 위한 명령어 (0) | 2013.09.07 | 
|---|---|
| Cisco 라우터에서 정적 라우팅을 설정하고 삭제하는 방법 (0) | 2013.09.07 | 
| VLAN 설정(정적 포트별 분리 구성) (0) | 2013.09.06 | 
| Cisco Switch에서 텔넷 접속 암호를 설정하고 관리하는 방법 (0) | 2013.09.06 | 
| [router] Secret 패스워드 (0) | 2013.09.06 |