III:在交换机上将相应vlan接口上应用vlan.</p>KC-S(config)#int f1/13
1 X7 _* @0 L$ s" H \: c$ JKC-S(config-if)#switchport access vlan 10 #将当前接口应用到vlan
( o) I2 F! ^( Z" ~2 r# W. lKC-S(config-if)#no sh6 M3 K2 `% c% O
KC-S(config-if)#exit+ J0 ?/ v9 a0 P" M" X n
KC-S(config)#int f1/14
7 H% H. z& b( g4 n! O4 RKC-S(config-if)#switchport access vlan 10% f6 M% o' Y3 c& W* c4 y% v# l
KC-S(config-if)#exit) B- G! W* r- b# @) ]
KC-S(config)#int f1/15+ \% t& ?# x" x$ \! w3 W: L
KC-S(config-if)#switchport access vlan 208 e( {* p& g: U3 W& o
KC-S(config-if)#exit
( o5 F# d9 R3 r. eKC-S#sh vlan-switch2 M9 c A: @% W" E! h8 {' b. O" \
IV:PC-1不能ping通PC-2或PC-3,但PC-2和PC-3可以互通,可见vlan将主机阻隔 B% S& E/ I# ]& Q
PC-1#ping 192.168.2.1
- l: B5 t6 i9 H! cType escape sequence to abort./ B7 ?0 I% m# U4 N5 o
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:" |; F2 ?$ }5 d% B8 b" R
…# ?4 z9 h- O2 r0 ]1 K% x+ K& P9 W
Success rate is 0 percent (0/3)
% @5 I3 C M+ ^2 h; @: xPC-2#ping 192.168.2.2# P( I; ~5 D" u2 U) q8 `" j- _! d2 h- n
Type escape sequence to abort." T( Y2 o* c+ `3 ^0 B
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
: Y4 D9 K7 D) `' x: y( L; u!!!!!
, q6 k) V. E* `; W2 a3 e$ nSuccess rate is 100 percent (5/5), round-trip min/avg/max = 56/76/96 ms/ U4 f0 s& {0 _' E! a0 W
PC-2#
; P% {: b! C) F+ V% m, |PC-3#ping 192.168.2.1+ K9 C- g: r$ b/ |: |+ W. Z
Type escape sequence to abort.
' U8 m/ M1 M% @" GSending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
- V7 i5 {% M" V4 s: y.!!!!, l+ D, x0 F% |. T1 ]" ?3 j, b H7 b, ?
Success rate is 80 percent (4/5), round-trip min/avg/max = 48/70/88 ms |