实验二

实验二以失败告终(遗憾)望指正。

 

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

  一、实验目的: 

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协议产生的路由优先级高。

 

三、实验设备:

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

 

四、实验拓扑图

 

 

 

五、实验过程:

三层交换机的基本配置

Switch>enable

Switch#vlan database

% Warning: It is recommended to configure VLAN from config mode,

  as VLAN database mode is being deprecated. Please consult user

  documentation for configuring VTP/VLAN in config mode.

 

Switch(vlan)#

Switch(vlan)#vlan 10 name VLAN10

VLAN 10 modified:

    Name: VLAN10

Switch(vlan)#vlan 20 name VLAN20

VLAN 20 modified:

    Name: VLAN20

Switch(vlan)#

Switch(vlan)#exit

APPLY completed.

Exiting....

Switch#configure terminal

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

Switch(config)#interface FastEthernet0/1

Switch(config-if)#

Switch(config-if)#

Switch(config-if)#switchport access vlan 10

Switch(config-if)#

Switch(config-if)#exit

Switch(config)#interface FastEthernet0/2

Switch(config-if)#

Switch(config-if)#exit

Switch(config)#interface FastEthernet0/2

Switch(config-if)#

Switch(config-if)#

Switch(config-if)#switchport access vlan 20

Switch(config-if)#interface vlan 10

Switch(config-if)#

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

Switch(config-if)#interface VLAN10

Switch(config-if)#ip address 123.123.123.1 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#interface VLAN20

Switch(config-if)#ip address 123.123.124.1 255.255.255.0

Switch(config-if)#no shutdown

 

Switch#show vlan

 

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6

                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10

                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14

                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18

                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22

                                                Fa0/23, Fa0/24, Gig0/1, Gig0/2

10   VLAN10                           active    Fa0/1

20   VLAN20                           active    Fa0/2

Router 2上配置端口IP

Router>enable

Router#config

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

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

Router(config)#interface fastethernet 1/0

Router(config-if)#ip address 123.123.12.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 123.123.13.1 255.255.255.0

Router(config-if)#Clock rate 64000

Router(config-if)#no shutdown

Router 1上配置端口IP

Router>enable

Router#config

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

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

Router(config)#interface fasterthernet 0/0

                              ^

% Invalid input detected at '^' marker.

 

Router(config)#interface fastethernet 0/0

Router(config-if)#ip addres 123.123.14.1 255.255.255.0

Router(config-if)#no shutdown

 

Router(config-if)#

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

Router(config-if)#ip address 123.123.15.2 255.255.255.0

Router(config-if)#no shutdown

 

Router(config-if)#

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

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

Router#show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol

 

FastEthernet0/0        unassigned      YES manual administratively down down

 

FastEthernet1/0        123.123.12.1    YES manual up                    up

 

Serial2/0              123.123.13.1    YES manual up                    down

 

Serial3/0              unassigned      YES manual administratively down down

 

FastEthernet4/0        unassigned      YES manual administratively down down

 

FastEthernet5/0        unassigned      YES manual administratively down down

Router#show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol

 

FastEthernet0/0        123.123.14.1    YES manual up                    up

 

FastEthernet1/0        unassigned      YES manual administratively down down

 

Serial2/0              123.123.15.2    YES manual up                    down

 

Serial3/0              unassigned      YES manual administratively down down

 

FastEthernet4/0        unassigned      YES manual administratively down down

 

FastEthernet5/0        unassigned      YES manual administratively down down

配置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 123.123.123.0

Switch(config-router)#network 123.123.124.0

Switch(config-router)#version2

                             ^

% Invalid input detected at '^' marker.

 

Switch(config-router)#version 2

Switch(config-router)#

2)Router 2配置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 123.123.12.0

Router(config-router)#network 123.123.13.0

Router(config-router)#version 2

Router(config-router)#no auto-summary

3)Router 1配置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)#

Router(config-router)#network 123.123.15.2

Router(config-router)#network 123.123.14.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

 

     123.0.0.0/24 is subnetted, 2 subnets

C       123.123.123.0 is directly connected, Vlan10

C       123.123.124.0 is directly connected, Vlan20

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

 

     123.0.0.0/24 is subnetted, 1 subnets

C       123.123.12.0 is directly connected, FastEthernet1/0

Router#

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

 

     123.0.0.0/24 is subnetted, 1 subnets

C       123.123.14.0 is directly connected, FastEthernet0/0

Router#

配置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 123.123.124.0 area 0

                                             ^

% Invalid input detected at '^' marker.

 

Switch(config-router)#network 123.123.124.0 255.0.0.0 area 0

Switch(config-router)#network 123.123.123.0 255.255.255.0 area 0

Switch(config-router)#end

Router2配置

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 123.123.12.0 255.255.255.0 area 0

Router(config-router)#network 123.123.13.0 255.255.255.0 area 0

Router(config-router)#end

Router#

Router1配置

Router#config

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

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

Router(config)#network 123.123.15.0 255.255.255.0 area 0

                ^

% Invalid input detected at '^' marker.

 

Router(config)#router ospf 1

Router(config-router)#network 123.123.15.0 255.255.255.0 area 0

Router(config-router)#network 123.123.14.0 255.255.255.0 area 0

Router(config-router)#netwo

% Incomplete command.

Router(config-router)#end

 

posted @ 2023-06-02 21:08  布吉岛???  阅读(31)  评论(0编辑  收藏  举报