標題:
Cisco 2960 設定示範
[打印本頁]
作者:
admin
時間:
2011-12-1 23:50
標題:
Cisco 2960 設定示範
no service pad
! z9 }* r+ S k/ S
service timestamps debug datetime msec localtime show-timezone
* I0 o6 e4 l" x9 j T* r
service timestamps log datetime localtime show-timezone
6 O2 ]9 {" W3 u. V
no service password-encryption
, @ `1 c: _ j1 m, G: C. a, G
!
3 g- ^. Q* H) n
hostname MY_SWITCH
[[[ Set switch hostname ]]]
0 ~9 `# d9 x, i! W4 S
!
. s; f' W' S9 a' H1 u
username XXXXX secret 5 $1$i/aq$6gVcvlv2b7H6cLeDUGnhw0
) n; {$ u. m/ a5 C- _
enable secret 5 $1$4KgT$eQ0xNzP8Q5lTdtLm/hFHJ1
. g- ?) l3 ]0 t1 u2 n L
!
+ H c9 l6 @: s- r
clock timezone HKT 8
[[[ Set Hong Kong Time Zone ]]]
9 `/ z! Y. y2 m: q
!
- _$ y( z# c- ~$ a* Q
vtp mode transparent
[[[ VTP = Vlan trunking protocol ]]]
3 F; @1 V6 f V; V1 R) V
!
( E0 c O I3 Y3 N
spanning-tree mode pvst
4 g/ E4 a7 w' ^( }: I4 o) W; r. ?
no spanning-tree optimize bpdu transmission
9 J i" U! y; y7 Y$ Q s8 A
spanning-tree extend system-id
/ e3 }$ n/ Z, I$ \5 o" v
!
B% x" f8 T0 i" w( T
interface FastEthernet0/1
[[[ Set access port in certain ports to allow certain Vlan ]]]
_' f+ w- I, p8 Z- u7 z9 b( @
switchport mode access
) w( B8 y! z2 K( ^ _3 z
switchport access vlan 2
2 d% e8 p1 r/ b5 E# N# p8 Q! k7 S) c
!
6 K; n1 Z, V; [7 q% V
interface FastEthernet0/2
- c* q7 `$ |! W& T. D
switchport mode access
0 n Q+ V+ |- h: v- {$ D
switchport access vlan 2
9 H" Q. v9 ~; m; [; Q2 Y
!
2 l }4 u: b: b7 ]' i+ D9 [
interface FastEthernet0/3
: p+ d8 r) L5 D4 I' k# _: _
switchport mode access
; d& t, g. h2 h& L" ?! Z1 S" v& l
switchport access vlan 3
6 k7 h3 M& _7 c' E: G$ K7 K
!
5 Q9 X: S: ^# | C: q
interface FastEthernet0/4
1 S" i9 ]6 M4 {0 k8 M
switchport mode access
k. b8 K! @7 Z8 A6 [
switchport access vlan 3
6 B/ b' E Q5 _0 E; J; n" V
!
y4 f- Z. I' k2 X6 ?
interface FastEthernet0/5
" b; O9 ~$ X) [- X1 w
switchport mode access
0 A; n( |1 i: R9 }+ l
switchport access vlan 2
& w8 |* l( }; X1 U
!
- T1 A! B0 U. U4 q
interface FastEthernet0/6
$ A8 b) d- i' d3 u; e9 j& D0 J: }' Y
switchport mode access
8 ?/ A/ S$ f4 K! A. ?1 `: y
switchport access vlan 2
4 d9 M) Z$ p/ T. C' u1 W3 p0 j
!
. g( D$ s0 J! V( L, I$ k
interface FastEthernet0/7
7 [5 |. T1 t2 F4 [* O+ S3 n' [5 d
switchport mode access
' V0 x' U G: {- d
switchport access vlan 3
! B' ~/ a- u# a7 @ B8 X, Y' ]
!
; d$ }, S. ]7 ~- e. Y+ y
interface FastEthernet0/8
' A8 T2 [8 W c+ a6 } D
no ip address
, ?; N( B2 G0 @& W }
!
& n$ e C' u0 Q3 M1 m! C) J
interface FastEthernet0/9
m# j0 F3 R6 m5 j" v1 `8 d& q
no ip address
( b/ E8 R5 T: b8 M8 n! i
!
]- q* \$ R. [2 a8 X8 t
interface FastEthernet0/10
! k2 Z9 @; Z( c
no ip address
+ s7 B& ~$ f+ g! x
!
( I+ J, c* ?& Q
interface FastEthernet0/11
) y' N) I3 K& v/ U% o( q
switchport mode access
5 X. F0 x! ?* s6 D8 G6 x
switchport access vlan 3
7 d8 W- _. J, F% f3 u# Z. x1 c2 j& V7 X
!
( D! F9 |# B! A( e
interface FastEthernet0/12
' K2 S8 P/ y' L
switchport mode access
- g( N0 H% ?. ~& b7 h( r
switchport access vlan 2
; E- h" O/ ?1 e/ @5 h% E" w) _
!
# s' o: D w# D# Z" _
interface FastEthernet0/13
& Y9 M2 ~: q& l1 X
switchport mode access
. e9 d% T) q, b' \$ n' |# e
switchport access vlan 3
h3 t! w% ^0 i% a0 X
!
/ F, x4 {0 ?0 m9 Q
interface FastEthernet0/14
8 M, c$ R' h" j. a
no ip address
0 n1 E: B5 E4 @5 j2 _% f
!
/ s: a% m$ c2 L2 T
interface FastEthernet0/15
8 T, i$ l* L% x1 r8 D, D% n
no ip address
4 J3 _0 J- ^' d4 t2 K* U7 T
!
# D/ |/ U1 D# V3 h9 a) ?
interface FastEthernet0/16
/ A1 b. ? v' d0 B$ c
no ip address
$ q8 x- A, a5 O
!
2 ?' b k) t- s8 g2 L& I; @
interface FastEthernet0/17
# F/ A1 ~, k7 M$ c2 X1 P
no ip address
2 E7 T: t6 \/ [
!
7 Q4 |2 ^! {6 }
interface FastEthernet0/18
% {2 j% j- C7 I, o5 t; L) R+ C
no ip address
& S# _, L/ H/ m- L E
!
# f/ o4 L% O& M, C4 p, P' ]
interface FastEthernet0/19
! K- q) {( R+ y! C
no ip address
7 w: A/ n, `1 Q+ }, s* V& @
!
' A) o% e2 t+ v0 V) x( K
interface FastEthernet0/20
9 E- ?" ]; a7 y1 i4 x" F: e3 L' Q
no ip address
, ~! ~* h# A+ |- |- M
!
6 x7 P1 {4 l& ?& n8 s
interface FastEthernet0/21
0 P/ Y0 l& H* o- ~) P0 H
no ip address
( Z3 U' j9 b0 a2 ~, [
!
6 C3 ]7 ^6 L8 n$ U/ w) s* H
interface FastEthernet0/22
+ [3 x+ R" n5 A7 D* |& r
no ip address
# ^( r: ]! k' _. V- a
!
j' M6 z9 e; S- v3 Z: y
interface FastEthernet0/23
3 l0 @6 s! l. Z0 O6 @+ d
no ip address
4 Z2 V. j2 H& v' B
!
4 ]; ~" q: `, y! [3 `- F
interface FastEthernet0/24
) ]& c" T! ]0 p; ?% o
no ip address
# k# w* V% U" g- C: t! Z+ h
!
& n4 E& n4 u1 S7 u) `- h$ K2 X
interface GigabitEthernet0/1
[[[ Set trunk mode in uplink ports ]]]
5 \& C/ ^% U& O/ @
switchport mode trunk
" w- [: J/ l9 L* L0 U
!
4 _2 Z9 z8 J( u4 j7 d- O# G2 V
interface GigabitEthernet0/2
) G& O6 t7 `! K4 _! i# u; P# a/ L
switchport mode trunk
5 l L% K7 ~- G1 @ \/ t% [
!
( f: B8 v% @! s3 L& ?' _( H
interface Vlan1
[[[ Vlan 1 = native Vlan ]]]
* ?" F0 a+ _. N( W- Q, g: x3 s
ip address 172.18.25.203 255.255.255.0
% z- o; z! N7 l. p. j
!
0 @ a. z% w) ~
interface Vlan2
$ h. d7 a" o; d; _" B) n
ip address 172.18.25.203 255.255.255.0
. X; i0 j0 t4 u. G+ I5 c4 w$ F' t
!
. i/ ~- q9 F& x& I; j
interface Vlan3
' K, ? F5 e" t# q3 @& P8 U
ip address 172.18.25.203 255.255.255.0
( ~! J0 H' R j+ V) ]. T- u
!
$ u. h0 k. w, A5 C1 g8 `* C
ip default-gateway 172.18.25.44
[[[ Set gateway IP address ]]]]
% Q; o. \1 b2 S% M7 q, v; ~7 k/ A
!
F y$ ]% K4 c$ C! c
snmp-server community admin1234 RO
5 Y6 q' M1 ~8 W- b" U9 q. Q0 ^( y
logging 172.18.25.37
[[[ Set log server IP address ]]]
G6 m l! g9 g( {
!
: @0 c! @2 b O4 ]& K# r, j
line con 0
, x- S; ?& b2 \: U
password XXXXX
- ^, \% }. g: Y; W
line vty 0 4
1 M2 w5 E2 a$ r* W6 H
line vty 5 15
' `" [7 j+ V" Q7 ~3 _
!
. K- B) O3 J0 w. c0 R
ntp clock-period 17179912
[[[ NTP = network time protocol ]]]
+ j7 M' T! i/ \; n Y
ntp server 172.38.225.218
0 O4 C# Q' j$ O& @7 m) c. Q
end
歡迎光臨 How2Do (http://forum.how2do.com.hk/)
Powered by Discuz! 7.2