当前位置:文档之家› 锐捷网络实验手册

锐捷网络实验手册

锐捷网络实验手册
锐捷网络实验手册

锐捷网络实验手册

————————————————————————————————作者:————————————————————————————————日期:

实验一交换机的基本配置

1.基本配置:

网络拓扑

RG-Switch

?

实验环境

将RG-Switch的其中一以太网口连至PC的以太网口

实验配置

1.配置交换机主机名

Red-Giant>enable(注:从用户模式进入特权模式)

Red-Giant#configure terminal(注:从特权模式进入全局配置模式)

Red-Giant(config)#hostname SW1(注:将主机名配置为“SW1”)

SW1(config)#

2.配置交换机远程登陆密码

SW1(config)#enable secret level 1 0 star (注:将交换机远程登陆密码配置为“star”)

3.配置交换机特权模式口令

SW1(config)#enable secret level 15 0 star(注:将交换机特权模式口令配置为“star”)

4.为交换机分配管理IP地址

SW1(config)#interfacevlan1

SW1(config-if)#ip address 10.1.1.1 255.255.255.0

SW1(config-if)#no shutdown

注:为VLAN 1的管理接口分配IP地址(表示通过VLAN 1来管理交换机),设置交换机的IP地址为10.1.1.1,对应的子网掩码为255.255.255.0

5.显示交换机MAC地址表的记录

SW1#showmac-address-table

注:在PC上开一命令行窗口,运行命令:c:\>ping 10.1.1.1

能ping通则在交换机上执行show mac-address-table 可查看到PC的

MAC地址

注:PC的MAC地址可以在命令行下输入: ipconfig /all查看.

6.修改交换机MAC地址的老化时间

SW1(config)#mac-address-table aging-time

注:将交换机MAC地址老化时间设置为10秒

SW1(config)#end

注:从交换机全局配置模式返回至特权模式

SW1#show mac-address-table

注:显示交换机MAC地址表的记录

测试结果

从PC上TELNET到交换机.

验证命令

show int f0/1

show ip int

show run

ping

telnet

实验二 VLA N配置

1.VLA N/802.1Q-本交换机隔离

网络拓扑

实验项目?

VLAN/802.1Q-本交换机隔离测试

实验环境?

PC1连接在交换机的0/5 口;PC2连接在交换机的0/15 口

实验配置

S2126G#co nfigu re term inal

注:进入交换机全局配置模式

S2126G(config )# vlan 10

注:创建vlan 10

S2126G (co nf ig-vlan)# name t est 10

注:将Vlan 10命名为te st 10

S2126G(confi g)# vlan 20

注:创建vlan 20

S 2126G(co nfig -vla n)# n ame test20

注:将Vlan 20命名为test 20

S 2126G(confi g-if)# int erface fas tether net 0/5 注:进入f astet her net 0/5的接口配置模式

S2126G(config-if)# swit ch acc ess vlan 10

注:将f ast ethernet 0/5端口加入vl an 10中 S2126G PC 1 PC 2

S 2126G (co nfi g-if)# inte rfac e fastet he rn et 0/15

注:进入f aste thernet 0/15的接口配置模式

S2126G (c onfig-if)# switch acce ss v la n 20

注:将faste ther ne t 0/15端口加入vl an 20中

实验过程?

清空交换机原有vlan 配置,将fastethern et0/5口加入vlan 10 , 将fast eth ernet0/15口加入vlan 20 。

实验结果?

PC 1地址设成192.168.10.0/24的地址, P C2地址设成192.168.20.0/24的地址

PC1 与P C 2 不能相互ping 通。

2.VLAN/802.1Q-跨交换机VLAN

网络拓扑

实验项目?

V LAN/802.1Q -跨交换机V LAN测试

实验环境?

两台交换机的fast 0/24互联,其中一台交换机的f ast 0/5和fast0/15连接PC1和PC2,另一台交换机的fast0/5接P C3

实验配置?

交换机S3550-24: S2126G PC 1 vlan PC3 vlan S3550-24 PC 2 vlan

SWITCH#configure terminal

注:进入交换机全局配置模式

SWITCH(config)# vlan 10

注:创建vlan 10

SWITCH(config-vlan)# name test10

注:将Vlan 10命名为test10

SWITCH(config)# vlan 20

注:创建vlan20

SWITCH(config-vlan)#name test20

注:将Vlan 20命名为test20

SWITCH(config-if)# interface fastethernet 0/5注:进入fastethernet 0/5的接口配置模式

SWITCH(config-if)# switch access vlan 10

注:将fastethernet 0/5端口加入vlan 10中

SWITCH(config-if)# interface fastethernet 0/15

注:进入fastethernet 0/15的接口配置模式

SWITCH(config-if)# switch access vlan 20

注:将fastethernet 0/15端口加入vlan 20中

SWITCH(config-if)# interface fastethernet0/24

注:进入fastethernet 0/24的接口配置模式

SWITCH(config-if)# switchport mode trunk

注:将fastethernet 0/24设为tag vlan模式

交换机S2126G:

SWITCH#configureterminal

注:进入交换机全局配置模式

SWITCH(config)# vlan 10

注:创建vlan 10

SWITCH(config-vlan)# nametest10

注:将Vlan 10命名为test10

SWITCH(config-if)# interface fastethernet 0/5注:进入fastethernet0/5的接口配置模式

SWITCH(config-if)# switch access vlan 10

注:将fastethernet 0/5端口加入vlan 10中

SWITCH(config-if)# interface fastethernet 0/24 注:进入fastethernet 0/24的接口配置模式

SWITCH(config-if)# switchportmode trunk

注:将fastethernet 0/24设为tag vlan模式

实验过程?

分别在两台交换机上做如上配置

验证命令:

show vlan

s how int f0/24 switchport

实验结果

P C1与PC3地址都设成192.168.10.0/24的地址.P C2地址都设成192.168.20.0/24的地址.

当PC1与PC3都分别接在两台交换机的fas t 0/5 时,即在同一V lan 中,可互相p in g 通,当PC2与PC1,P C3不在同一vlan 中则不通。

?实验三 生成树协议

1.生成树-802.1D

网络拓扑

实验项目?

生成树协议802.1D 测试

实验环境?

用两台支持802.1d 的交换机用两条双绞线互联。

实验配置

S2126G#configure te rminal

注:进入全局配置模式 STAR-S2126G

STAR-S2126G

S2126G(config)#spanning-tree

注:启用交换机生成树协议

S2126G(config)#spanning-tree mode stp

注:将交换机生成树模式设置为802.1d

S2126G(config)#end

注:返回特权模式

S2126G#show spanning-tree

注:显示交换机生成树协议的状态

S2126G#show spanning-tree interface fastethernet 0/2

注:显示交换机fastethernet 0/2端口的生成树状态

实验过程

在一台非根S2126上执行上述命令后过1分钟,用show spanning-tree inter face fast0/2 ,show spanning-treeinterface fast 0/4查看,并查看S2126G的相应端口,这四个端口中应有一个端口处于discarding状态,其余端口处于forwarding状态

实验结果?

当有两个端口都连在一个共享介质上,交换机会选择一个高优先级(数值小)的端口进入forwarding状态,低优先级(数值大)的端口进入discarding状态。如果两个端口的优先级一样,就选端口号小的那个进入forwarding状态。

辅助命令

1.S2126G(config)#spanning-tree priority <0-61440>

注:配置交换机优先级,“0”或“4096”的倍数(RSTPBPDU该值后12bit全0)

2.S2126G(config-if)#spanning-tree port-priority <0-240>

注:配置交换机端口优先级,“0”或“16”的倍数(RSTP BPDU该值后4bit全0)

2.生成树-802.1W

网络拓扑

STAR-S2126G STAR-S2126G

?

实验项目?

快速生成树802.1W测试

实验环境?

用一台支持802.1w的交换机与STAR-S2126G交换机用两条双绞线互联(这里用两台STAR-S2126G为例,分别连接在0/2、0/4口)

实验配置

S2126G#configure terminal

注:进入全局配置模式

S2126G(config)#spanning-tree

注:启用交换机生成树协议

S2126G(config)#spanning-tree mode rstp

注:将交换机生成树模式设置为802.1w

S2126G(config)#end

注:返回特权模式

S2126G#show spanning-tree

注:显示交换机生成树协议的状态

S2126G#show spanning-tree interface fastethernet 0/2

注:显示交换机fastethernet 0/2端口的生成树状态

实验过程

在一台非根S2126G上执行上述命令后过5秒,用show spanning-tree interfac e fast 0/2 ,show spanning-tree interface fast 0/4查看,应为一个端口StpPortState应处于discarding,另一端口StpPortState应处于fo rwarding状态

实验结果

当有两个端口都连在一个共享介质上,交换机会选择一个高优先级(数值小)的端口进入forwarding状态,低优先级(数值大)的端口进入discarding状态。如果两个端口的优先级一样,就选端口号小的那个进入forwarding状态。

辅助命令

1.S2126G(config)#spanning-treepriority <0-61440>

注:配置交换机优先级,“0”或“4096”的倍数(RSTPBPDU该值后12bit全0) 2.S2126G(config-if)#spanning-tree port-priority<0-240>

注:配置交换机端口优先级,“0”或“16”的倍数(RSTP BPDU该值后4bit全0)

实验四 路由器的基本配置

网络拓扑

实验配置

A 路由器的配置:

一.基本配置:

2.配置路由器主机名

Red-Gia nt>enab le(注:从用户模式进入特权模式)

Red-Giant#conf ig ure termina l(注:从特权模式进入全局配置模式) Re d-Giant(conf ig )#hos tn ame A(注:将主机名配置为“A ”) A(config )#

2.配置路由器远程登陆密码

A(c onfig)# li ne vty 0 4 (注:进入路由器vty0至vty4虚拟终端线路模式) A(c onfig-li ne)#logi n

A(config-li ne)#password st ar

(注:将路由器远程登陆口令设置为“star ”)

3.配置路由器特权模式口令

A(co nfi g)#enable pa ssw ord sta r

或:

A (config )#e nab le se cret star

(注:将路由器特权模式口令配置为“st ar”)

4.为路由器各接口分配IP 地址

A (con fi g)#i nterface ser ial 0

注:进入路由器ser ial 0的接口配置模式(常见的路由器接口:fast et hernet 0,fastether net 1,…,fas te thernet n;se rial 0,serial 1,…,seria l n) A(c onf ig -if)#ip addr ess 172.16.2.2 255.255.255.0 172.16.2.1 F0:172.16.1.1/24 B 172.16.2.2

A B 172.16.1.2/24

F0:172.16.3.1/24 B B 172.16.3.2/24 A S0

D S0 DTE

注:设置路由器serial 0的IP地址为172.16.2.2,对应的子网掩码为255.255.255.0

A(config)#interfacefastethernet 0

注:进入路由器fastethernet 0的接口配置模式(常见的路由器接口:fastethernet 0,fastethernet 1,…,fastethernet n;serial 0,serial 1,…,serial n)

A(config-if)#ip address 172.16.3.1 255.255.255.0

注:设置路由器fastethernet0的IP地址为172.16.3.1,对应的子网掩码为255.255.255.0

二.配置接口时钟频率(DCE):

A(config)#interface serial 0

注:进入路由器serial 0的接口配置模式(常见的路由器接口:fastethernet 0,fastethernet 1,…,fastethernet n;serial 0,serial 1,…,serial n)

R2624(config-if)clock rate 64000

注:设置接口物理时钟频率为64Kbps

B 路由器的配置:

一.基本配置:

1.配置路由器主机名

Red-Giant>enable(注:从用户模式进入特权模式)

Red-Giant#configure terminal(注:从特权模式进入全局配置模式)

Red-Giant(config)#hostname B(注:将主机名配置为“B”)

B(config)#

2.配置路由器远程登陆密码

B(config)#line vty 0 4 (注:进入路由器vty0至vty4虚拟终端线路模式)

B(config-line)#login

B(config-line)#password star

(注:将路由器远程登陆口令设置为“star”)

3.配置路由器特权模式口令

B(config)#enable passwordstar

或:

B(config)#enable secret star

(注:将路由器特权模式口令配置为“star”)

4.为路由器各接口分配IP地址

B(config)#interface serial 0

注:进入路由器serial 0的接口配置模式(常见的路由器接口:fastethernet 0,fastethernet 1,…,fastethernet n;serial 0,serial 1,…,se rial n)

B(config-if)#ip address 172.16.2.1 255.255.255.0

注:设置路由器serial 0的IP地址为172.16.2.1,对应的子网掩码为255.255.255.0

A(config)#interface fastethernet 0

注:进入路由器fastethernet 0的接口配置模式(常见的路由器接口:fastetherne t0,fastethernet1,…,fastethernet n;serial 0,serial 1,…,serial n)

A(config-if)#ip address172.16.1.1 255.255.255.0

注:设置路由器fastethernet0的IP地址为172.16.1.1,对应的子网掩码为255.255.255.0

验证命令:

showrun

show controllers s 0

show int

show ip int brief

ping

telnet

测试结果:

1.查看路由器端口为up, up.

2.两台路由器互相ping Serial口的地址,应该为通.

3.两台主机分别ping与其直连的路由器的Fastethernet口,应为通.

4.从与路由器A相连的主机可以telnet到A,与路由器B相连的主机可以telnet到B.

实验五 路由协议

1.静态路由

网络拓扑

实验内容

通过静态路由,使路由器A ,B 具有非直连子网的路由信息。

实验配置

A 路由器的配置:

一.基本配置:

3.配置路由器主机名

Re d-Gian t>e na ble(注:从用户模式进入特权模式)

Red-Giant#c onfigure t er mina l(注:从特权模式进入全局配置模式) R ed-Gi ant (co nfig )#ho stn ame A (注:将主机名配置为“A ”) A(con fig)#

2.配置路由器远程登陆密码

A(conf ig)# li ne vty 0 4 (注:进入路由器v ty0至v ty4虚拟终端线路模式) A (con fig-line)#login

A(config -line)#password sta r

(注:将路由器远程登陆口令设置为“st ar ”)

3.配置交换机特权模式口令

A(confi g)#enable pass word st ar

或:

A(config )#enable secre t star

(注:将交换机特权模式口令配置为“st ar ”)

172.16.2.1 F0:172.16.1.1/24 B 172.16.2.2

A B 172.16.1.2/24 网关:172.16.1.1 F0:172.16.3.1/24 B B

172.16.3.2/24 网关:172.16.3.1 A S0

D S0 DTE

4.为路由器各接口分配IP地址

A(config)#interface serial 0

注:进入路由器serial 0的接口配置模式(常见的路由器接口:fastethernet0,fastethernet 1,…,fastethernet n;serial 0,serial1,…,serial n)

A(config-if)#ip address 172.16.2.2 255.255.255.0

注:设置路由器serial 0的IP地址为172.16.2.2,对应的子网掩码为255.255.255.0

A(config)#interface fastethernet 0

注:进入路由器fastethernet 0的接口配置模式(常见的路由器接口:fastethernet 0,fastethernet 1,…,fastethernet n;serial 0,serial 1,…,serial n)

A(config-if)#ip address 172.16.3.1 255.255.255.0

注:设置路由器fastethernet 0的IP地址为172.16.3.1,对应的子网掩码为25

5.255.255.0

二.配置接口时钟频率(DCE):

A(config)#interface serial 0

注:进入路由器serial 0的接口配置模式(常见的路由器接口:fastethernet 0,fas tethernet 1,…,fastethernet n;serial 0,serial 1,…,serial n)

R2624(config-if)clock rate 64000

注:设置接口物理时钟频率为64Kbps

三.配置静态路由:

A(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1

或:

A(config)#ip route 172.16.1.0 255.255.255.0 serial 0

B路由器的配置:

一.基本配置:

2.配置路由器主机名

Red-Giant>enable(注:从用户模式进入特权模式)

Red-Giant#configure terminal(注:从特权模式进入全局配置模式)

Red-Giant(config)#hostname B(注:将主机名配置为“B”)

B(config)#

2.配置路由器远程登陆密码

B(config)#line vty 0 4 (注:进入路由器vty0至vty4虚拟终端线路模式)

B(config-line)#login

B(config-line)#password star

(注:将路由器远程登陆口令设置为“star”)

3.配置交换机特权模式口令

B(config)#enable password star

或:

B(config)#enable secret star

(注:将交换机特权模式口令配置为“star”)

4.为路由器各接口分配IP地址

B(config)#interface serial 0

注:进入路由器serial0的接口配置模式(常见的路由器接口:fastetherne t 0,fastethernet 1,…,fastethernet n;serial0,serial 1,…,se rial n)

B(config-if)#ip address 172.16.2.1 255.255.255.0

注:设置路由器serial 0的IP地址为172.16.2.1,对应的子网掩码为255.255.255.0

A(config)#interface fastethernet 0

注:进入路由器fastethernet 0的接口配置模式(常见的路由器接口:fastethernet0,fastethernet 1,…,fastethernet n;serial 0,serial 1,…,serial n)

A(config-if)#ip address 172.16.1.1 255.255.255.0

注:设置路由器fastethernet 0的IP地址为172.16.1.1,对应的子网掩码为255.255.255.0

二.配置静态路由:

B(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.2

或:

B (co nfi g)#ip route 172.16.3.0 255.255.255.0 serial 0

验证命令:

sh ow ip i nt b ri ef

sh ow i p route

pin g

实验结果

A,B 各路由器应该看到全网路由。主机172.16.3.2能够访问主机172.16.1.2。 2.动态路由(RIP)

网络拓扑

实验内容

通过动态路由RIP ,使路由器A,B 具有非直连子网的路由信息。

实验配置

A 路由器的配置:

一.基本配置:

4.配置路由器主机名

Red-Gian t>ena ble(注:从用户模式进入特权模式)

Red-Gia nt#conf igure termi nal (注:从特权模式进入全局配置模式)

Red-G ian t(config)#hostn ame A (注:将主机名配置为“A ”) 172.16.2.1 F0:172.16.1.1/24 B 172.16.2.2

A B 172.16.1.2/24 网关:172.16.1.1 F0:172.16.3.1/24 B

B 172.16.3.2/24 网关:172.16.3.1 A S0

D S0 DTE

A(config)#

2.配置路由器远程登陆密码

A(config)#line vty0 4 (注:进入路由器vty0至vty4虚拟终端线路模式) A(config-line)#login

A(config-line)#password star

(注:将路由器远程登陆口令设置为“star”)

3.配置交换机特权模式口令

A(config)#enable password star

或:

A(config)#enable secretstar

(注:将交换机特权模式口令配置为“star”)

4.为路由器各接口分配IP地址

A(config)#interface serial 0

注:进入路由器serial 0的接口配置模式(常见的路由器接口:fastethernet 0,fa stethernet 1,…,fastethernet n;serial0,serial 1,…,serial n)

A(config-if)#ip address 172.16.2.2 255.255.255.0

注:设置路由器serial 0的IP地址为172.16.2.2,对应的子网掩码为255.255.255.0

A(config)#interface fastethernet 0

注:进入路由器fastethernet 0的接口配置模式(常见的路由器接口:fasteth ernet 0,fastethernet 1,…,fastethernet n;serial 0,serial1,…,serial n)

A(config-if)#ip address 172.16.3.1 255.255.255.0

注:设置路由器fastethernet 0的IP地址为172.16.3.1,对应的子网掩码为255.255.255.0

二.配置接口时钟频率(DCE):

A(config)#interface serial 0

注:进入路由器serial0的接口配置模式(常见的路由器接口:fastethernet 0,fastethernet1,…,fastethernet n;serial 0,serial 1,…,serial n)

R2624(config-if)clock rate 64000

相关主题
文本预览
相关文档 最新文档