VLAN실습

◾ VLAN별 Telnet 접속

VLAN2와 VLAN3의 PC에서 스위치에 telnet 접속을 수행한다.

sw1(config)#vlan 2
sw1(config-vlan)#name vlan2
sw1(config-vlan)#exit
sw1(config)#vlan 3
sw1(config-vlan)#name vlan3
sw1(config-vlan)#exit
sw1(config)#do 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
                                                Gig0/1, Gig0/2
2    vlan2                            active    
3    vlan3                            active

sw1(config)#int Fa0/4
sw1(config-if)#switchport access vlan 2
sw1(config-if)#switchport mode access
sw1(config-if)#exit
sw1(config)#int Fa0/5
sw1(config-if)#switchport access vlan 2
sw1(config-if)#switchport mode access
sw1(config-if)#exit
sw1(config)#int Fa0/6
sw1(config-if)#switchport access vlan 3
sw1(config-if)#switchport mode access
sw1(config-if)#exit
sw1(config)#int Fa0/7
sw1(config-if)#switchport access vlan 3
sw1(config-if)#switchport mode access
sw1(config-if)#exit
sw1(config)#do show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/8
                                                ...
2    vlan2                            active    Fa0/4, Fa0/5
3    vlan3                            active    Fa0/6, Fa0/7

 

VLAN 주소 설정

sw1(config)#int vlan2
sw1(config-if)#
%LINK-5-CHANGED: Interface Vlan2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up

sw1(config-if)#ip address 192.168.12.102 255.255.255.0
sw1(config-if)#no shutdown 
sw1(config-if)#exit
sw1(config)#inter
sw1(config)#interface vlan3
sw1(config-if)#
%LINK-5-CHANGED: Interface Vlan3, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to up

sw1(config-if)#ip address 192.168.13.103 255.255.255.0
sw1(config-if)#no shutdown
sw1(config-if)#exit
sw1(config)#exit
sw1#
%SYS-5-CONFIG_I: Configured from console by console

sw1#copy runn
sw1#copy running-config start
sw1#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
sw1#

Telnet 접속 설정

sw1(config)#line vty 0 4
sw1(config-line)#login
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
sw1(config-line)#password kitri03

 

PC4에서 telnet 접속

자신의 VLAN에서만 접속이 가능하다. 다른 VLAN 접속은 못한다.

C:\>telnet 192.168.12.102
Trying 192.168.12.102 ...Open


User Access Verification

Password: 
sw1>exit

[Connection to 192.168.12.102 closed by foreign host]
C:\>telnet 192.168.13.103
Trying 192.168.13.103 ...
% Connection timed out; remote host not responding
C:\>

◾ 여러 스위치에서 VLAN 간 통신 실습

VLAN 1 : all
VLAN 10 : fa0/10 ~ fa0/14
VLAN 20 : fa0/20 ~ fa0/24

sw2(config)#vlan 10
sw2(config-vlan)#name vlan10
sw2(config-vlan)#exit
sw2(config)#vlan 20
sw2(config-vlan)#name vlan20
sw2(config-vlan)#exit
sw2(config)#do 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
                                                Gig0/1, Gig0/2
10   vlan10                           active    
20   vlan20                           active

 

VLAN 포트 설정

sw1(config)#interface range fa0/10-14
sw1(config-if-range)#switchport access vlan 10
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#exit
sw1(config)#int range fa0/20-24
sw1(config-if-range)#switchport access vlan 20
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#exit
sw1(config)#do 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/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Gig0/1, Gig0/2
10   vlan10                           active    Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14
20   vlan20                           active    Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24

 

sw1(config)#int g0/1
sw1(config-if)#sw ac vlan 10
sw1(config-if)#sw mode ac
sw1(config-if)#do 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/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Gig0/2
10   vlan10                           active    Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Gig0/1
20   vlan20                           active    Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24

 

sw2(config)#int g0/2
sw2(config-if)#
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/2 (1), with sw1 GigabitEthernet0/2 (20).

sw2(config-if)#sw ac vlan 20
sw2(config-if)#sw mode access
sw2(config-if)#do 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/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19
10   vlan10                           active    Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Gig0/1
20   vlan20                           active    Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24, Gig0/2

테스트는 컴퓨터에서 각 vlan별로 통신이 되는지 확인


◾ 여러 스위치에서 VLAN 간 통신 실습 - TRUNK

 

Trunk 는 모든 VLAN의 패킷을 전송

sw1, sw2 둘다 설정

sw1(config)#int g0/1
sw1(config-if)#no sw mode access
Command rejected: An interface must be configured to the Access or Trunk	modes to be configured to NoNegotiate.
sw1(config-if)#no switchport access vlan 10
sw1(config-if)#switchport mode trunk

sw1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

sw1(config-if)#do show int trunk
Port        Mode         Encapsulation  Status        Native vlan
Gig0/1      on           802.1q         trunking      1

Port        Vlans allowed on trunk
Gig0/1      1-1005

Port        Vlans allowed and active in management domain
Gig0/1      1,10,20

Port        Vlans in spanning tree forwarding state and not pruned
Gig0/1      none

 

테스트는 컴퓨터에서 각 vlan별로 통신이 되는지 확인

PC1_1에서 PC1_2로 테스트

C:\>ping 1.1.1.12

Pinging 1.1.1.12 with 32 bytes of data:

Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128

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

◾ VLAN Routing 실습

VLAN간에 통신은 반드시 L3 장치를 통해서 가능하다.

• VLAN 10 : 192.168.10.0/24 : fa10 ~ fa14
• VLAN 20 : 192.168.20.0/24 : fa20 ~ fa14
• S0 gi0/1, gi0/2는 각각 R0의 gi0/0, gi0/1에 연결.
• VLAN 10 GW : R0 gi0/0
• VLAN 20 GW : R0 gi0/1

 

스위치 설정

S0(config)#vlan 10
S0(config-vlan)#name vlan10
S0(config-vlan)#vlan 20
S0(config-vlan)#name vlan20
S0(config-vlan)#do 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
                                                Gig0/1, Gig0/2
10   vlan10                           active    
20   vlan20                           active
...
S0(config)#int range f0/10-14, g0/1
S0(config-if-range)#switch access vlan 10
S0(config-if-range)#switchport mode access
S0(config-if-range)#int range f0/20-24, g0/2
S0(config-if-range)#sw ac vlan 20
S0(config-if-range)#sw mode access
S0(config-if-range)#do 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/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19
10   vlan10                           active    Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Gig0/1
20   vlan20                           active    Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24, Gig0/2

 

라우터 설정

R0(config)#interface g0/0
R0(config-if)#ip address 192.168.10.1 255.255.255.0
R0(config-if)#no shut
R0(config-if)#no shutdown 

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

R0(config-if)#int g0/1
R0(config-if)#ip address 192.168.20.1 255.255.255.0
R0(config-if)#no shutdown

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

R0(config-if)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     192.168.10.1        YES manual up                    up 
GigabitEthernet0/1     192.168.20.1        YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down

 

테스트는 PC에서 진행한다.

PC1, PC2에서 둘다 진행하면 ping이 잘 가는 것을 확인할 수 있다.

C:\>ping 192.168.10.1

Pinging 192.168.10.1 with 32 bytes of data:

Reply from 192.168.10.1: bytes=32 time=19ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255

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

C:\>ping 192.168.20.1

Pinging 192.168.20.1 with 32 bytes of data:

Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255

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

◾ VLAN Routing Trunk 실습

 

◾ VLAN간에 통신은 반드시 L3 장치를 통해서 가능하다.
• VLAN 10 : 192.168.10.0/24 : fa10 ~ fa14
• VLAN 20 : 192.168.20.0/24 : fa20 ~ fa14
• S0 gi0/1는 R0의 gi0/0에 연결.
- 트렁크로 지정 VLAN 10,20의 GW로 사용한다.
- R0의 gi0/0에 IP를 두 개 설정한다.

 

Switch 설정

S0(config)#interface range gi0/1-2
S0(config-if-range)#no sw ac vlan
S0(config-if-range)#do 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/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Gig0/1, Gig0/2
10   vlan10                           active    Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14
20   vlan20                           active    Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24

 

Router 설정

S0(config)#int g0/1
S0(config-if)#sw mode trunk

S0(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

S0(config-if)#do show int trunk
Port        Mode         Encapsulation  Status        Native vlan
Gig0/1      on           802.1q         trunking      1

 

이전 실습의 ip를 해제한다.

R0(config)#int g0/0
R0(config-if)#no ip address
R0(config-if)#no ip address 
R0(config-if)#shutdown 

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down

R0(config-if)#int g0/1
R0(config-if)#no ip address
R0(config-if)#shutdown

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to administratively down

R0(config-if)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     unassigned      YES manual administratively down down 
GigabitEthernet0/1     unassigned      YES manual administratively down down 
Vlan1                  unassigned      YES unset  administratively down down

 

라우터에 가상 인터페이스를 생성해 ip를 할당한다.

R0(config)#int g0/0
R0(config-if)#no shutdown

R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

R0(config-if)#int g0/0.10
R0(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.10, changed state to up

R0(config-subif)#encapsulation dot1q 10
R0(config-subif)#ip address 192.168.10.1 255.255.255.0
R0(config-subif)#int g0/0.20
R0(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.20, changed state to up

R0(config-subif)#encapsulation dot1q 20
R0(config-subif)#ip address 192.168.20.1 255.255.255.0
R0(config-subif)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     unassigned      YES manual up                    up 
GigabitEthernet0/0.10  192.168.10.1    YES manual up                    up 
GigabitEthernet0/0.20  192.168.20.1    YES manual up                    up
GigabitEthernet0/1     unassigned      YES manual administratively down down 
Vlan1                  unassigned      YES unset  administratively down down

 

PC에서 테스트

C:\>ping 192.168.10.1

Pinging 192.168.10.1 with 32 bytes of data:

Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255

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

C:\>ping 192.168.20.1

Pinging 192.168.20.1 with 32 bytes of data:

Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255

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

 

'네트워크 공부 기록' 카테고리의 다른 글

정적 라우팅 구현 실습 (라우팅 정보 입력 및 Default 라우팅)  (0) 2022.01.14
Router 및 정적 라우팅  (0) 2022.01.14
VLAN  (0) 2022.01.13
STP  (0) 2022.01.11
Switch  (0) 2022.01.11

◾ collision domain

HUB

◾ broadcast domain

* collision : 네트워크에 흘러가는 전기적인 신호

 

HUB에는 CPU, 메모리가 없다.

네트워크에 허브만 늘어나면 네트워크가 점점 느려진다.

 

패킷을 보내기 작업

carrier sense 확인

모든 station 에 전달 : multiple access (NAT network) > 더미 네트워크

-> 이더넷 방식

두곳에서 패킷을 보내면 collision signal이 일어남

충돌이 일어나면 잠시 멈춘다. -> collision dectection

collision이 발생했을때 어디까지 도착하느냐 > collision domain (스니핑 가능)

전체 collision이 발생하는지 확인 가능

 

 

브리지 장비를 이용 (브리지에는 cpu, 메모리 있음)

learning

PC0에서 PC1으로 패킷을 보내면 switch가 learning하고, 

switch 가 

0>1, 2>3, 4>5 이렇게 패킷을 동시에 보낼 수 있다.

 

pc0와 pc2가 동시에 pc1에 보내면 switch가 버퍼에 저장

 

pc0 > pc1에 패킷을 보내면 어디까지는 collision domain

 

이러한 네트워크에서

collision domain : 8개

broadcast domain : 1개

 

VLAN

• VLAN(Virtual LAN)은 스위치내부를 여러 개의 독립 스위치 장비처럼 분할해주거나 이웃 스위치와 통합하는 기능을 제공한다.
• 대규모 네트워크에서 브로드캐스트 트래픽을 차단해주는 역할 제공한다.
• 각각의 VLAN 은 마치 단독의 별도 장치처럼 패킷을 송수신한다.
• VLAN은 각 스위치의 포트별로 설정하며 기본값은 모든 포트가 VLAN1에 속해 있다.

 

◾ VLAN으로 환경 구성
• PC1, PC2 ..는 각각 Fa0/1, Fa0/2 ..에 연결된다.

◾ VLAN 관련 명령
• show vlan : 현재 VLAN 확인
• show interface status : 각 인터페이스의 상태 확인
• vlan database : VLAN 생성
 - vlan ## name [vnan name]  ‐ VLAN 모드에서 작업
• vlan ## : VLAN 생성
 - name vlan [vnan name]  ‐ VLAN 인터페이스에서 작업
• switchport access vlan ## : 인터페이스를 VLAN에 할당
• switchport mode [access | trunk | dynamic ] : 인터페이스의 mode 정의
  (+ dynamic [auto | desirable] )

 

◾ 스위치의 VLAN 상태 확인

sw1#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
                                                Gig0/1, Gig0/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 fddi  101002     1500  -      -      -        -    -        0      0   
1003 tr    101003     1500  -      -      -        -    -        0      0   
1004 fdnet 101004     1500  -      -      -        ieee -        0      0   
1005 trnet 101005     1500  -      -      -        ibm  -        0      0   
...

sw1#show interface status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          auto    auto  10/100BaseTX
Fa0/2                        connected    1          auto    auto  10/100BaseTX
Fa0/3                        connected    1          auto    auto  10/100BaseTX
Fa0/4                        connected    1          auto    auto  10/100BaseTX
Fa0/5                        notconnect   1          auto    auto  10/100BaseTX
...

 

◾ VLAN 생성

글로벌 모드에서 vlan 지정

sw1(config)#vlan 2
sw1(config-vlan)#name vlan2
sw1(config)#vlan 3
sw1(config-vlan)#name vlan3
sw1(config-vlan)#exit
sw1(config)#vlan 4
sw1(config-vlan)#name vlan4
sw1(config-vlan)#exit
sw1(config)#do 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
                                                ...
2    vlan2                            active    
3    vlan3                            active    
4    vlan4                            active

 

◾ VLAN에 인터페이스를 할당한다.
• 개별 인터페이스 모드에서 작업한다.
• access 모드는 필수가 아니다.

sw1(config)#do show interface status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          auto    auto  10/100BaseTX
Fa0/2                        connected    1          auto    auto  10/100BaseTX
Fa0/3                        connected    1          auto    auto  10/100BaseTX
Fa0/4                        connected    1          auto    auto  10/100BaseTX
...

sw1(config)#interface Fa0/2
sw1(config-if)#switchport access vlan 2
sw1(config-if)#switchport mode access
sw1(config-if)#exit
sw1(config)#interface Fa0/3
sw1(config-if)#switchport access vlan 3
sw1(config-if)#switchport mode access
sw1(config-if)#exit
sw1(config)#interface Fa0/4
sw1(config-if)#switchport access vlan 4
sw1(config-if)#switchport mode access
sw1(config-if)#do show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/5, Fa0/6, Fa0/7
                                                ...
2    vlan2                            active    Fa0/2
3    vlan3                            active    Fa0/3
4    vlan4                            active    Fa0/4

sw1(config-if)#do show interface status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          auto    auto  10/100BaseTX
Fa0/2                        connected    2          auto    auto  10/100BaseTX
Fa0/3                        connected    3          auto    auto  10/100BaseTX
Fa0/4                        connected    4          auto    auto  10/100BaseTX

 

'네트워크 공부 기록' 카테고리의 다른 글

Router 및 정적 라우팅  (0) 2022.01.14
VLAN 실습  (0) 2022.01.13
STP  (0) 2022.01.11
Switch  (0) 2022.01.11
IOS(Internetwork Operating System) 및 IP 설정  (0) 2022.01.05

+ Recent posts