实验二:配置路由器

发布于:2024-04-17 ⋅ 阅读:(18) ⋅ 点赞:(0)

1.实验环境

实验用具包括两台路由器 (或交换机),一根双绞线缆台PC,一条Console线缆

2.需求描述

  • 通过Console口配置路由器接口IP地址,实现设备通信

将两台路由器的Gig0/0接口相连.通过一台PC连接设备的Console端口并配置P地址(192.168.1.0/24).实现设备之间的互通。

  • 设备通信正常后,保存配置,将配置文件备份到PC机

3.推荐步骤

  1. 将两台路由器分别命名为 R1和R2,并在路由器上配置P 地址,分别为 192.168.1.1/24192.168.1.2/24
  2. 验证两台路由器的连通性
  3. 保存配置。可通过“show ster”命令确认配置信息已经存储成功
  4. 备份配置文档。将超级终端中显示的所有配置信息保存下来,粘贴到新建的文本文档中(可命名为 R1).

4.实验步骤

4.1、配置路由器R1

R1(config)#interface gigabitEthernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
4.2、配置路由器R2
R2(config)#interface gigabitEthernet 0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown 
R2(config-if)#exit

5、使用调试

5.1、使用ping测试路由器的连通性。
R1#ping 192.168.1.2       //使用ping命令测试
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
.!!!!                     //感叹号表示两路由器之间能够ping通
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms
5.2、查看配置文件
R1#show startup-config       //查看启动时使用的配置文件
startup-config is not present   //因为配置文件未保存,所以没有开机启动配置文件
R1#
5.3、保存配置文件
R1#write                    //使用write命令保存配置文件
Building configuration...
[OK]
R1#show startup-config      //再次查看配置文件
Using 700 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
......
//可以看到开机时需要调用的配置文件
5.4、备份配置文件

通过复制粘贴的方式就可以简单的备份配置文件了。