</p>IV:PC-1不能ping通PC-2或PC-3,但PC-2和PC-3可以互通,可见vlan将主机阻隔
% ?( l. g" q0 u) l D
- G- m t# E' k/ r8 e6 F) U3 ]& NPC-1#ping 192.168.2.1
$ y- K! E# O0 D4 Z) bType escape sequence to abort.
2 ?2 | Z7 W: V, O' ESending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:* }$ V2 ^* W% ^7 k
…/ H0 |# m3 C2 Y e! @+ L% B
Success rate is 0 percent (0/3)
Z ?5 m8 D0 i. O4 IPC-2#ping 192.168.2.2
, e- ~- F s( z- E( {; k* VType escape sequence to abort., _+ n: m) s- A4 v
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:+ x! x; ~* w% l7 ?- J
!!!!!
: q, S/ |2 K% v7 T6 @, dSuccess rate is 100 percent (5/5), round-trip min/avg/max = 56/76/96 ms
% c. B: S# v( V) q; i1 [PC-2## M- ~1 K s: i N5 U
PC-3#ping 192.168.2.1% I* s+ s2 v3 P2 {. Q1 I, T
Type escape sequence to abort.
& j; O, x8 q3 Z& U) i( }3 G8 Q7 r# n1 N kSending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
# A9 Z; w4 a( m; w.!!!!* [. w. W2 S. X: z* c9 M! M' h* j
Success rate is 80 percent (4/5), round-trip min/avg/max = 48/70/88 ms
& O8 c+ F' ~1 q3 q; j+ \ f" e. j P
V:将KC-S的f1/1设定为trunk模式; `8 S8 \2 e' m" J0 M1 R
( V7 P& Y6 \/ u+ D5 x
KC-S(config)#int f1/1
5 U8 ]# k4 g9 n0 H' rKC-S(config-if)#switchport mode trunk #f1/1设定为trunk模式3 T+ y( T9 Q2 s& E% M
*Mar 1 00:27:29.035: %DTP-5-TRUNKPORTON: Port Fa1/1 has become dot1q trunk; w- B; _6 y' B3 G3 Y
KC-S(config-if)#exit$ ^# E/ a7 Q/ w4 z1 \
KC-S(config)#exit1 q& o. Q- v8 t& D! `
*Mar 1 00:27:37.735: %SYS-5-CONFIG_I: Configured from console by console7 B2 v( h$ e5 M$ U5 z; e
KC-S#sh int trunk #查看链路模式" h& r9 K1 Y: t) {, g' o
Port Mode Encapsulation Status Native vlan
/ U& X0 @2 z% p: q1 O+ Z. w' F3 dFa1/1 on 802.1q trunking 1+ G5 U+ N2 R8 v# ?- T d" c* d
VI:在路由器KC-R上设置撑持trunk通信,采用子接口模式。
8 C9 S# |$ B1 T/ V; t& A/ F
0 w- P9 M0 h1 a. f- }; {2 x; g9 P% `KC-R(config)#int f0/0
4 t" C3 T; ], `3 d' JKC-R(config-if)#no ip address #必需no ip address和no shutdown" r# \) X2 E: q. W& A, y5 J# C
KC-R(config-if)#no shut8 p! P/ a% i" ^, I4 X
KC-R(config-if)#exit
1 |9 J( x; l1 X
! f" [: k1 b% F: y8 PKC-R(config)# |