目录
任务场景一
【r1配置】
【r2配置】
【r3配置】
任务场景二
【r1配置】
【r2配置】
任务场景一
按照下图完成网络拓扑搭建和配置
任务要求:
通过在路由器R1、R2和R3上配置静态路由,实现网络中各终端PC能够正常通信。
【r1配置】
int e0/0/0
[R1-Ethernet0/0/0]ip address 192.168.1.254 24
[R1]int e0/0/1
[R1-Ethernet0/0/1]ip address 192.168.2.253 24
[R1]int gi0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.4.253 24
[R1]ip route-static 192.168.3.0 24 192.168.2.254
ip route-static 目标网络地址 子网掩码长度 下一跳地址
- ip route-static:静态路由配置关键字(华为 / 华三设备语法,Cisco 设备省略 static,直接用 ip route)。
- 192.168.3.0 24:目标网络地址及子网掩码(24 表示子网掩码为 255.255.255.0,即目标网络为 192.168.3.0/24)。
- 192.168.2.254:下一跳地址(Next Hop),即路由器将发往目标网络的数据包转发到的下一个设备的 IP 地址。
核心作用是:给指定数据包转发路径,当路由器需要将数据包发送到 192.168.3.0/24 网络时,会将数据包转发给 192.168.2.254 这个下一跳地址(通常是相邻路由器的接口 IP)。
查看路由表:[Router] display ip routing-table
[R1]ip route-static 192.168.5.0 24 192.168.4.254
[R1]ip route-static 192.168.6.0 24 192.168.4.254
【r2配置】
[R2]int e0/0/0
[R2-Ethernet0/0/0]ip address 192.168.2.254 24
[R2]int e0/0/1
[R2-Ethernet0/0/1]ip address 192.168.3.254 24
[R2]ip route-static 192.168.1.0 24 192.168.2.253
[R2]ip route-static 192.168.5.0 24 192.168.2.253
[R2]ip route-static 192.168.6.0 24 192.168.2.253
【r3配置】
[R3]int e0/0/0
[R3-Ethernet0/0/0]ip address 192.168.4.254 24
[R3-Ethernet0/0/0]int e0/0/1
[R3-Ethernet0/0/1]ip address 192.168.5.254 24
[R3]int gi0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.6.254 24
[R3]ip route-static 192.168.1.0 24 192.168.4.253
[R3]ip route-static 192.168.3.0 24 192.168.4.253
任务场景二
按照下图完成网络拓扑搭建和配置
任务要求:
通过在路由器R1上配置缺省路由,在路由器R2上配置静态路由,实现网络中各终端PC能够正常通信。
【r1配置】
[R1]int e0/0/0
[R1-Ethernet0/0/0]ip address 192.168.1.254 24
[R1-Ethernet0/0/0]int e0/0/1
[R1-Ethernet0/0/1]ip address 192.168.2.254 24
[R1]int gi0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
【r2配置】
[R2]int e0/0/0
[R2-Ethernet0/0/0]ip address 12.1.1.2 24
[R2-Ethernet0/0/0]int e0/0/1
[R2-Ethernet0/0/1]ip address 4.4.4.1 24
[R2-Ethernet0/0/1]int gi0/0/0
[R2-GigabitEthernet0/0/0]ip address 5.5.5.1 24
[R2]ip route-static 192.168.1.0 24 12.1.1.1
[R2]ip route-static 192.168.2.0 24 12.1.1.1