韩立刚老师CCNA学习视频记录。
静态路由学习,先搭建基础学习环境(3台路由器,2台交换机,2台PC机),总共分为4个网段(A/B/C/D),在配置静态路由让每个网段都能通。拓扑图如下。
一、配置基础环境
PC1配置
PC-1> ip 192.168.0.2/24 192.168.0.1
PC-1> save
PC2配置
PC-2> ip 192.168.1.2/24 192.168.1.1
PC-2> save
SW1配置
不需要配置地址
SW2配置
不需要配置地址
RT1
配置fastEthernet0/0口
R1#configure terminal
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shutdown
配置seria 2/0
R1(config)#interface serial 2/0
R1(config-if)#ip address 172.16.0.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
保存配置
R1#copy running-config startup-config
RT2
配置serial 2/1
R2#configure terminal
R2(config)#interface serial 2/1
R2(config-if)#ip address 172.16.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface serial 2/0
R2(config-if)#ip address 172.16.1.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
R2#copy running-config startup-config
RT3
R3#configure terminal
R3(config)#interface serial 2/1
R3(config-if)#ip address 172.16.1.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.1.1 255.255.255.0
R3(config-if)#no shutdown
R3#copy running-config startup-config
二、配置静态路由
配置静态路由,使得拓扑图中的每个网段都能通信。配置如下:
RT1
R1#configure terminal
R1(config)#ip route 172.16.1.0 255.255.255.0 172.16.0.2
R1(config)#ip route 192.168.1.0 255.255.255.0 172.16.0.2
R1#copy running-config startup-config
RT2
R2#configure terminal
R2(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.2
R2(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.2
R2#copy running-config startup-config
RT3
R3#configure terminal
R3(config)#ip route 172.16.0.0 255.255.255.0 172.16.1.1
R3(config)#ip route 192.168.0.0 255.255.255.0 172.16.1.1
R3#copy running-config startup-config
最后,验证连通性
PC1 ping PC2
PC-1> ping 192.168.1.2
192.168.1.2 icmp_seq=1 timeout
84 bytes from 192.168.1.2 icmp_seq=2 ttl=61 time=89.762 ms
84 bytes from 192.168.1.2 icmp_seq=3 ttl=61 time=89.762 ms
84 bytes from 192.168.1.2 icmp_seq=4 ttl=61 time=89.808 ms
84 bytes from 192.168.1.2 icmp_seq=5 ttl=61 time=89.820 ms
PC1 ping RT2
PC-1> ping 172.16.1.2
84 bytes from 172.16.1.2 icmp_seq=1 ttl=253 time=89.719 ms
84 bytes from 172.16.1.2 icmp_seq=2 ttl=253 time=74.844 ms
84 bytes from 172.16.1.2 icmp_seq=3 ttl=253 time=74.842 ms
84 bytes from 172.16.1.2 icmp_seq=4 ttl=253 time=74.800 ms
84 bytes from 172.16.1.2 icmp_seq=5 ttl=253 time=74.801 ms
PC1 ping RT3
PC-1> ping 172.16.0.2
84 bytes from 172.16.0.2 icmp_seq=1 ttl=254 time=44.929 ms
84 bytes from 172.16.0.2 icmp_seq=2 ttl=254 time=44.882 ms
84 bytes from 172.16.0.2 icmp_seq=3 ttl=254 time=44.881 ms
84 bytes from 172.16.0.2 icmp_seq=4 ttl=254 time=44.922 ms
84 bytes from 172.16.0.2 icmp_seq=5 ttl=254 time=44.840 ms
都能ping通,说明路由配置没有问题。本节实验成功 。