路由器基础配置以及静态路由配置

1、搭建网络

搭建网络拓扑、分配IP地址、划分网段、连接端口

2、配置路由器

路由器基础配置

复制代码
//进入全局配置模式
Router#enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

//配置高速同步串口serial2/0
Router(config)#int ser2/0
Router(config-if)#ip address 192.168.3.1 255.255.255.0    //指定该端口IP地址
Router(config-if)#clock rate 64000    //配置时钟频率
Router(config-if)#no shutdown        //开启端口
Router(config-if)#exit

//配置接口1
Router(config)#int f1/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown

另一交换机配置sernial2/0端口时,可以不用配置时钟频率

复制代码
//进入全局配置模式
Router#enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

//配置高速同步串口serial2/0
Router(config)#int ser2/0
Router(config-if)#ip address 192.168.3.2 255.255.255.0    //指定该端口IP地址
Router(config-if)#no shutdown        //开启端口
Router(config-if)#exit

//配置接口1
Router(config)#int f1/0
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
3、查看配置结果

发现路由器1下将会有两条直连路由,分别是 192.168.1.0和192.168.3.0

另一路由器下直连路由是192.168.2.0和192.168.3.0

此时主机不能通信

4、配置静态路由

配置静态路由时,在指明目标网络IP地址后,还需要继续输入下一跳地址

命令为 ip route 目标网络+子网掩码+下一跳地址

复制代码
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

//配置静态路由
Router(config)#int ser2/0
Router(config-if)#ip route 192.168.2.0 255.255.255.0 192.168.3.2
Router(config)#exit

配置结果

另一交换机对高速同步串口同样配置

5、主机通信

成功ping通

相关推荐
尼古拉斯·纯情暖男·天真·阿玮9 分钟前
实验五 拒绝服务攻击实验
网络·智能路由器
Xの哲學27 分钟前
Linux Tasklet 深度剖析: 从设计思想到底层实现
linux·网络·算法·架构·边缘计算
idcardwang41 分钟前
esp32s3-idf使用smart_config一键配网
网络
googleccsdn1 小时前
ENSP Pro Lab笔记:配置BGP EVPN VXLAN双栈(2)
网络·笔记·网络协议
min1811234561 小时前
HR人力资源招聘配置流程图制作教程
大数据·网络·人工智能·架构·流程图·求职招聘
weixin_516023072 小时前
ssh配合密钥连接
服务器·网络·ssh
tobias.b2 小时前
408真题解析-2009-36-网络-交换机转发机制
网络·智能路由器·408考研·408真题解析
Dreamboat_LX3 小时前
websocket-sockjs-stomp
网络·websocket·网络协议
一条闲鱼_mytube3 小时前
智能体设计模式(二)反思-工具使用-规划
网络·人工智能·设计模式
Godspeed Zhao3 小时前
现代智能汽车中的无线技术27——Wi-Fi(15)
网络·汽车·智能路由器