首页 > 其他分享 >实验二

实验二

时间:2023-06-02 21:22:33浏览次数:30  
标签:config 123.123 Switch 实验 Router router OSPF

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

 

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

  一、实验目的: 

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

 

标签:config,123.123,Switch,实验,Router,router,OSPF
From: https://www.cnblogs.com/mine-my/p/17452917.html

相关文章

  • 计网:实验二 路由器动态路由的配置方法
     一、实验目的: 1.理解动态路由的工作原理;2.学习并掌握动态路由协议RIP的配置;3.学习并掌握动态路由协议OSPF的配置;4.进一步学习路由器的配置命令。二、实验原理:RIP:RoutingInformationProtocol,路由信息协议,是应用较早、使用较普遍的IGP内部网关协议,适用于小型同类网络,是典型......
  • 实验 透视表 计数 len np.count_nonzero 正确与否
    实验透视表计数 len np.count_nonzero正确与否结果:len正确 np.count_nonzero错误结论:除去三行干扰行(原值均为缺失值)以外:未过账中,有1行无业务员名称无业务员名称中,有1行未过账即:未过账且无业务员名称有1行未过账且有业务员名称有57行已过账且无业务员名称有57行最......
  • 序列密码实验
    实验目的及要求(1)实现LFSR,寄存器位数n=10,反馈函数、初试值都自己定;(2)实现RC4,数组长度=8,密钥自己定;(3)基于实现的LFSR或RC4实现一个动态验证码生成器,每次生成6个伪随机十进制数,自己测下多少个输出后开始循环。==================================================================......
  • linux 递归和函数实验
     递归  作用:自己调用自己 1.例子:阶乘    2.遍历目录下所有文件  函数 1.函数能够接受一个参数,参数为用户名;判断一个用户是否存在如果存在,就返回此用户的shell和UID;并返回正常状态值;如果不存在,就说此用户不存在;并返回错误状态值;  2......
  • 【小实验】使用 wrk 的 docker 容器来压测另一个容器
    作者:张富春(ahfuzhang),转载时请注明作者和引用链接,谢谢!cnblogs博客zhihuGithub公众号:一本正经的瞎扯想压测容器环境的服务性能,发现两个麻烦:本地使用wrk,由于本地网络和容器服务器很远,压测效果不好;wrk找不到一个独立的二进制版本可以下载;go-wrk完全不可用。然后......
  • 实验六
    任务1//P286例8.17//对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块//打印不及格学生信息和所有学生信息程分别调用#include<stdio.h>#include<stdlib.h>#include<string.h>#defineN2//运行程序输入测试时,可以把这个数组改小一些输入......
  • 202183300215 刘璎珂 实验六
    实验4#include<stdio.h>#include<stdlib.h>#include<string.h>#defineN100typedefstruct{charnum[10];//学号ints1;//期末成绩ints2;//平时成绩doublesum;//总评charlevel[......
  • 实验6
    实验任务1//P286例8.17//对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块//打印不及格学生信息和所有学生信息程分别调用#include<stdio.h>#include<string.h>#defineN10//运行程序输入测试时,可以把这个数组改小一些输入测试typedef......
  • 实验6
    task4.c #include"stdafx.h"#include<stdio.h>#include<stdlib.h>#include<string.h>#defineN100typedefstruct{charnum[10];ints1;ints2;doublesum;charlevel[10];}STU;intfun(STUa[],int......
  • 实验6
    task4#include<stdio.h>#include<string.h>#defineN100typedefstruct{charnum[10];ints1;ints2;doublesum;charlevel[10];}STU;intfun(STUa[],intn,STUh[]);intmain(){STUs[N]={{"GA05",85,76},{"G......