6.13

 

 

五、实验过程:

1、基本配置

1)三层交换机的基本配置

Switch(config)#vlan 10

Switch(config-vlan)#

Switch(config-vlan)#

Switch(config-vlan)#end

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#interface FastEthernet0/1

Switch(config-if)#

%SYS-5-CONFIG_I: Configured from console by console

Switch(config-if)#exit

Switch(config)#interface FastEthernet0/1

Switch(config-if)#

Switch(config-if)#

Switch(config-if)#switchport access vlan 10

Switch(config-if)#exit

Switch(config)#vlan 50

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#interface FastEthernet0/1

Switch(config-if)#

%SYS-5-CONFIG_I: Configured from console by console

Switch(config-if)#exit

Switch(config)#interface FastEthernet0/2

Switch(config-if)#switchport access vlan 50

Switch(config-if)#exit

Switch(config)#interface vlan 10

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan10, changed state to up

Switch(config-if)#ip address 172.16.1.2 255.255.255.0

Switch(config-if)#exit

Switch(config)#interface vlan 50

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan50, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan50, changed state to up

Switch(config-if)#ip address 172.16.5.1 255.255.255.0

Switch(config-if)#no shutdown

验证测试:

Switch#show ip interface

FastEthernet0/1 is up, line protocol is up

  Internet protocol processing disabled

FastEthernet0/2 is up, line protocol is up

  Internet protocol processing disabled

FastEthernet0/3 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/4 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/5 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/6 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/7 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/8 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/9 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/10 is down, line protocol is down

  Internet protocol processing disabled

FastEthernet0/11 is down, line protocol is down

  Internet protocol processing disabled

 --More--

2)   路由器基本配置

在路由器A上配置端口IP

Router>enable

Router#

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#interface FastEthernet0/0

Router(config-if)#ip address 172.16.1.1 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#interface serial 0/3/0

Router(config-if)#ip address 172.16.2.1 255.255.255.0

Router(config-if)#Clock rate 64000

Router(config-if)#no shutdown

在路由器B上配置端口IP

Router(config)#interface Serial0/3/0

Router(config-if)#ip address 172.16.2.2 255.255.255.0

Router(config-if)#

Router(config-if)#exit

Router(config)#interface FastEthernet0/0

Router(config-if)#ip address 172.16.3.1 255.255.255.0

Router(config-if)#ip address 172.16.3.1 255.255.255.0

Router(config-if)#

Router(config-if)#exit

验证测试:验证路由器接口的配置和状态

Router#show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol

 

FastEthernet0/0        172.16.1.1      YES manual administratively down down

 

FastEthernet0/1        172.16.1.1      YES manual up                    up

 

Serial0/0/0            172.16.2.1      YES manual up                    down

 

Serial0/0/1            unassigned      YES manual administratively down down

 

Vlan1                  unassigned      YES manual administratively down down

Router#

 

Router#show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol

 

FastEthernet0/0        172.16.3.1      YES manual up                    up

 

FastEthernet0/1        unassigned      YES manual administratively down down

 

Serial0/0/0            unassigned      YES manual up                    down

 

Serial0/0/1            unassigned      YES manual administratively down down

 

Vlan1                  unassigned      YES manual administratively down down

Router#

2、配置RIPv2路由协议

1)三层交换机配置RIP协议

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#router rip

Switch(config-router)#network 172.16.1.0

Switch(config-router)#network 172.16.5.0

Switch(config-router)#version 2

Switch(config-router)#

Switch#

%SYS-5-CONFIG_I: Configured from console by console

2)RA配置RIP v2协议

Router#enable

Router#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#router rip

Router(config-router)#network 172.16.1.0

Router(config-router)#network 172.16.2.0

Router(config-router)#version 2

Router(config-router)#no auto-summary

3)RB配置RIP v2协议

Router#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#router rip

Router(config-router)#network 172.16.2.0

Router(config-router)#network 172.16.3.0

Router(config-router)#version 2

Router(config-router)#no auto-summary

3、验证三台路由设备的路由表,查看是否自动学习了其他网段的路由信息。

Switch#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

     172.16.0.0/24 is subnetted, 2 subnets

C       172.16.1.0 is directly connected, Vlan10

C       172.16.5.0 is directly connected, Vlan50

 

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

     172.16.0.0/24 is subnetted, 2 subnets

C       172.16.1.0 is directly connected, FastEthernet0/1

R       172.16.5.0 [120/1] via 172.16.1.2, 00:00:23, FastEthernet0/1

 

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

     172.16.0.0/24 is subnetted, 1 subnets

C       172.16.3.0 is directly connected, FastEthernet0/0

4、配置OSPF路由协议

三层交换机

Switch#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#router ospf 1

Switch(config-router)#network 172.16.5.0 0.0.0.255 area 0

Switch(config-router)#network 172.16.1.0 0.0.0.0 area 0

路由器R0:

Router>enable

Router#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#router ospf 1

Router(config-router)#network 172.16.1.0 0.0.0.255 area 0

Router(config-router)#network 172.16.2.0 0.0.0.255 area 0

Router(config-router)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

路由器R1:

Router>enable

Router#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#router ospf 1

Router(config-router)#network 172.16.2.0 0.0.0.255 area 0

Router(config-router)#network 172.16.3.0 0.0.0.255 area 0

Router(config-router)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

5、测试网络的连通性

从pc0 ping pc1和网络跟踪命令:

 

六、实验总结:

 本次实验遇到的最大的问题是在前期准备阶段,画好拓扑图并进行连接的时候,即便我按照实验指导配好了相关的指令,还是不能连通路由器RB和PC1,后来索性换了一根线缆,就妥了。

  首先百度得知,直通线是用来连接直通线是将不同设备连接在一起,比如电脑和交换机,而交叉线是用来连接相同类型的设备的。后来通过进一步的了解得知,现在较新设备的网口都支持自动识别直通线或交叉线,因而交叉线正在逐渐消亡。虽然依然很迷,但是起码它最后还是通了。

  配置OSPF协议也是完全通过百度搜相关资料才解决的。
posted @   yblll  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示