配置路由器实现互通

1.实验环境

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

2.需求描述

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

图6.14 实验案例二示意图

验证设备互通成功后,保存设备的配置,并将配置文件备份到PC上。

3.推荐步骤

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

4.实验步骤

4.1 命名和配置IP地址

配置路由器R1
复制代码
Router>enable
Router#configure terminal
Router(config)#hostname 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
配置路由器R2
复制代码
Router>enable
Router#configure terminal
Router(config)#hostname 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

4.2 验证路由器之间的连通性

复制代码
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 100 percent (5/5), round-trip min/avg/max = 0/0/3 ms

4.3 保存配置并查看

查看配置文件
复制代码
R1#show startup-config       //查看启动时使用的配置文件
startup-config is not present   //因为配置文件未保存,所以没有开机启动配置文件
R1#
保存配置文件
复制代码
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
!
ip cef
no ipv6 cef
!
license udi pid CISCO2911/K9 sn FTX1524C3R2-
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/2
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end
//可以看到开机时需要调用的配置文件

4.4 备份配置并命名为"R1"

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

至此试验结束。

相关推荐
zizisuo5 小时前
面试篇:Spring Security
网络·数据库·安全
玉笥寻珍5 小时前
Web安全渗透测试基础知识之HTTP参数污染篇
网络·网络协议·安全·web安全·http
GCKJ_08245 小时前
观成科技:加密C2框架Vshell流量分析
网络·科技·信息与通信
大蚂蚁2号7 小时前
windows文件共享另一台电脑资源管理器网络文件夹无法找到机器
运维·服务器·网络
LetsonH7 小时前
Home Assistant 米家集成:开启智能家居新体验
网络·智能家居
欧先生^_^7 小时前
Docker 的各种网络模式
网络·docker·容器
彬彬醤8 小时前
查询电脑伪装IP,网络安全速查攻略!
网络·网络协议·tcp/ip·安全·web安全·http·https
兴达易控10 小时前
Profibus DP主站转Modbus TCP网关接E+H流量计通讯案例
网络
熙曦Sakura10 小时前
【Linux网络】TCP全连接队列
linux·网络·tcp/ip
国产化创客12 小时前
OpenHarmony轻量系统--BearPi-Nano开发板网络程序测试
网络·物联网·harmonyos·国产化