2024/5/22

所花时间:3小时

代码行:160行

博客量:1篇

了解到的知识点:

实验二  路由器动态路由的配置方法

  一、实验目的: 

1.理解动态路由的工作原理;

2. 学习并掌握动态路由协议RIP的配置;

3.学习并掌握动态路由协议OSPF的配置;

4.进一步学习路由器的配置命令。

二、实验原理:

RIP:Routing Information Protocol,路由信息协议,是应用较早、使用较普遍的IGP内部网关协议,适用于小型同类网络,是典型的距离矢量协议。

RIP协议跳数作为衡量路径开销的,RIP协议里规定最大跳数为15。

RIP协议有两个版本RIPv1和RIPv2。

RIPv1属于有类路由协议,不支持VLSM(变长子网掩码),RIPv1是以广播的形式进行路由信息的更新的;更新周期为30秒。

RIPv2属于无类路由协议,支持VLSM(变长子网掩码),RIPv2是以组播的形式进行路由信息的更新的,组播地址是224.0.0.9。RIPv2还支持基于端口的认证,提高网络的安全性。

OSPF协议用链路状态来评估路由,可用于规模很大的网络。

OSPF可通过区域划分网络,对于规模较小的网络一般只设置一个区域0,对于规模较大的网络,可划分多个区域,其中区域0是必不可少的,它用于连接其它各区域。

OSPF协议采用组播方式进行OSPF包交换,组播地址为224.0.0.5(全部OSPF路由器)和224.0.06(指定路由器)。

OSPF协议的管理距离是110,低于RIP协议的120,所以如果设备同时运行OSPF协议和RIP协议,则OSPF协议产生的路由优先级高。

三、实验设备:

计算机、二层交换机、路由器

四、实验拓扑图

 

五、实验过程:

1、基本配置

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

Switch>enable

Switch#config

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

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

Switch(config)#vlan 10

Switch(config-vlan)#interface fastethernet0/1

Switch(config-if)#switchport access vlan 10

Switch(config-if)#vlan 50

Switch(config-vlan)#interface fastethernet0/5

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)#no shutdown

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(config-if)#exit

Switch(config)#exit

Switch#

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

Switch#show vlan

 

Switch#show ip interface

Vlan10 is up, line protocol is down

  Internet address is 172.16.1.2/24

  Broadcast address is 255.255.255.255

  Address determined by setup command

  MTU is 1500 bytes

  Helper address is not set

  Directed broadcast forwarding is disabled

  Outgoing access list is not set

  Inbound  access list is not set

  Proxy ARP is enabled

  Local Proxy ARP is disabled

  Security level is default

  Split horizon is enabled

  ICMP redirects are always sent

  ICMP unreachables are always sent

  ICMP mask replies are never sent

  IP fast switching is disabled

  IP fast switching on the same interface is disabled

  IP Null turbo vector

  IP multicast fast switching is disabled

  IP multicast distributed fast switching is disabled

  IP route-cache flags are None

  Router Discovery is disabled

  IP output packet accounting is disabled

  IP access violation accounting is disabled

  TCP/IP header compression is disabled

  RTP/IP header compression is disabled

  Probe proxy name replies are disabled

  Policy routing is disabled

  Network address translation is disable

  WCCP Redirect outbound is disabled

  WCCP Redirect inbound is disabled

  WCCP Redirect exclude is disabled

  BGP Policy Mapping is disabled

Vlan50 is up, line protocol is up

  Internet address is 172.16.5.1/24

  Broadcast address is 255.255.255.255

  Address determined by setup command

  MTU is 1500 bytes

  Helper address is not set

  Directed broadcast forwarding is disabled

  Outgoing access list is not set

  Inbound  access list is not set

  Proxy ARP is enabled

  Local Proxy ARP is disabled

  Security level is default

  Split horizon is enabled

  ICMP redirects are always sent

  ICMP unreachables are always sent

  ICMP mask replies are never sent

  IP fast switching is disabled

  IP fast switching on the same interface is disabled

  IP Null turbo vector

  IP multicast fast switching is disabled

  IP multicast distributed fast switching is disabled

  IP route-cache flags are None

  Router Discovery is disabled

  IP output packet accounting is disabled

  IP access violation accounting is disabled

  TCP/IP header compression is disabled

  RTP/IP header compression is disabled

  Probe proxy name replies are disabled

  Policy routing is disabled

  Network address translation is disable

  WCCP Redirect outbound is disabled

  WCCP Redirect inbound is disabled

  WCCP Redirect exclude is disabled

  BGP Policy Mapping is disabled

2) 路由器基本配置

在路由器A上配置端口IP

Router>enable

Router#configure terminal

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

Router(config)#interface FastEthernet1/0

Router(config-if)#ip address 172.16.1.1 255.255.255.0

Router(config-if)#no shutdown

 

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

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

Router(config-if)#interface serial 2/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-if)#inter fastethernet 1/0

Router(config-if)#ip address 172.16.3.1 255.255.255.0

Router(config-if)#no shutdown

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

Router(config-if)#ip address 172.16.2.2 255.255.255.0

Router(config-if)#no shutdown

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

RA#show ip interface brief

 

RB#show ip interface brief

 

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

2)RA配置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.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>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.2.0

Router(config-router)#network 172.16.3.0

Router(config-router)#version 2

Router(config-router)#no auto-summary

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

 

 

 

4、配置OSPF路由协议

1) 在交换机上配置OSPF路由协议。

 

2) 在路由器RA上配置OSPF路由协议。

 

3) 在路由器RB上配置OSPF路由协议。

 

5、测试网络的连通性

从PCA ping PCB

 

网络跟踪命令:

tracert   172.16.3.22

结果:显示到达目的主机经过的每一跳路由的接口地址

 

 

六、实验总结:

在本次实验中,我学习了动态路由的工作原理以及两种动态路由协议RIP和OSPF的配置。动态路由允许路由器动态地学习网络拓扑和选择最佳路径,而不需要手动配置路由表。通过配置RIP协议,我了解到它使用跳数作为路径选择的度量标准,适用于小型网络,配置简单但对大型网络不够灵活。而OSPF协议则是基于链路状态的协议,使用带宽等因素作为路径选择的依据,适用于大型网络,但配置相对复杂。在学习过程中,我深入了解了路由器的各种配置命令,包括设置接口IP地址、启用路由协议、配置路由策略等。这些知识对于理解和优化网络性能至关重要。我对动态路由的工作原理有了更深的理解,掌握了RIP和OSPF协议的配置方法,同时也对路由器的配置命令有了更多的认识,这将对今后的网络管理和故障排除工作有很大帮助。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2024-05-22 19:21  为20岁努力  阅读(1)  评论(0编辑  收藏  举报