a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 140|回复: 0

[CCNA] 单臂路由

[复制链接]
发表于 2012-8-3 20:28:11 | 显示全部楼层 |阅读模式
     一、配置交换机8 R! j+ j/ ~5 I0 L+ {6 J
    Switch>en             ----进入特权模式
& C" F3 B( q5 Z: q9 A0 k% W    Switch#config t          ----进入全局配置模式, d: l' Q5 N6 `$ m
    Enter configuration commands, one per line. End with CNTL/Z.
4 K7 O9 F5 H8 b% C  w8 ?4 H, g3 @    Switch(config)#vlan 10          ----配置第一个vlan4 A5 D0 I+ ?, g! N; [. q1 @  U
    Switch(config-vlan)#name 10         ----给vlan命名/ n0 `. `( V: m% h. n7 S
    Switch(config-vlan)#exit
+ N7 `4 U3 P0 g- |    Switch(config)#vlan 20            ----配置第一个vlan1 G5 X/ ?  u6 d, @5 B( Z% H
    Switch(config-vlan)#name 20          ----给vlan命名
+ i' o) k/ N, P+ k    Switch(config-vlan)#exit
% E: R; h% i+ d! |    Switch(config)#int f0/1                  ----进入f0/1端口/ N4 k$ s8 ?" |; Y$ Q1 R3 [' Q  M
    Switch(config-if)#switchport access vlan 10     ----把端口分配给vlan10
: b7 t& s# c& T& u: a8 t    Switch(config-if)#exit6 M, F  i9 I) F
    Switch(config)#int f0/11$ M' J; d7 l2 b1 Z9 U0 H) C0 m
    Switch(config-if)#switchport access vlan 20
: I. \& L8 K9 {! t/ P( D9 V    Switch(config-if)#exit1 g6 p+ U5 @2 o0 \. a  M9 _; i
    Switch(config)#int f0/244 o5 m  v) B" ?8 I* D3 ~* ^
    Switch(config-if)#switchport mode trunk  --配置f0/24为TRUNK模式
+ H, r6 [9 r9 {% e5 H* }7 J    Switch(config-if)#exit, M: A. A3 z% @
    二、    配置路由器2 J  B7 w- j9 \2 M  k1 L$ Z
    Router>en
: Z9 H! @2 c3 y  ~: s. X    Router#config t
( K3 {% v# X  S. \/ l    Enter configuration commands, one per line. End with CNTL/Z.5 m* }! A1 J3 |. \1 v3 Z- v2 ~
    Router(config)#int f0/0     ----进入f0/0端口
& z" n, @, t; @' r6 X+ u    Router(config-if)#no ip add      ----不配置IP地址: u4 D1 Y- R; i! p8 N8 t
    Router(config-if)#no shutdown      ----开启端口
1 Z) z+ b" I" q! X    %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
1 }- {  p" s0 L2 ?+ d: X    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
: M; m7 F& F2 W7 \1 B    Router(config-if)#exit' \/ O2 u, \5 W- x' a
    Router(config)#int f0/0.1       ----配置子接口
8 b+ z- a2 t% c, R2 w  {; I    %LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
' g+ d% U2 \1 L4 a5 a    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up# m; A" `" g/ [* n+ C/ A" M0 R: P: N. v' n
    Router(config-subif)#encapsulation dot1Q 10           ----配置dot1Q协议
: `& c; `  m8 B2 q2 K7 t7 w" l    Router(config-subif)#ip address 192.168.1.254 255.255.255.0
- Q: Y% E) k. {; w8 S* N    Router(config-subif)#no shutdown
1 s* R) ~' I4 o* \) l5 C- b; M    Router(config-subif)#exit! V- s: o! |, B9 @& v' d
    Router(config)#int f0/0.2
( C8 R, e; |1 q+ R    %LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
. e5 s6 |# e! M) s9 S    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
! j3 C  t$ h" B6 Z" X    Router(config-subif)#encapsulation dot1Q 20
+ A' x4 ?+ o2 _- q( e# H    Router(config-subif)#ip add   192.168.2.254 255.255.255.0, v& {% h/ n' j4 x
    Router(config-subif)#no shutdown
7 J2 H9 I% t/ h% m) G; R# c; [    Router(config-subif)#exit
' O2 U, k& o4 j' d    Router(config)#% E9 k+ F: N! `" B% _( h  B
    三、    验证3 i. O/ L& A; j1 Z6 Y2 Q
    P1的IP地址7 S# k6 ~5 f, O( V) I
    P2的IP地址
8 i4 \2 K+ ^+ F4 q    P1能够ping通P2,P2能够ping通P1则配置成功。
3 ?: O; Z% u+ b) M! s- I                                 9 s% T! P  |& f# C; g# D
                                
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-6 01:00 , Processed in 0.248715 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表