设备 | 端口 | IP | 子网掩码 | 网关 |
Router-A | F0/0 | 192.168.1.1 | 255.255.255.0 | 无 |
F0/3 | 192.168.10.1 | 255.255.255.0 | 无 | |
Router-B | F0/0 | 192.168.1.2 | 255.255.255.0 | 无 |
F0/3 | 192.168.20.1 | 255.255.255.0 | 无 | |
PC1 | 192.168.10.2 | 255.255.255.0 | 192.168.10.1 | |
PC2 | 192.168.20.2 | 255.255.255.0 | 192.168.20.1 |
操作步骤:
步骤1:连接公司网络拓扑图。
步骤2:设置计算机的IP地址、子网掩码和网关。
步骤3:配置Router-A的名称及其接口IP地址。
Router_config#hostname Router-A
Router-A_config#interface Fastethernet 0/0
Router-A_config_f0/0#ip address 192.168.1.1 255.255.255.0
Router-A_config_f0/0#no shutdown
Router-A_config#interface Fastethernet 0/3
Router-A_config_f0/3#ip address 192.168.10.1 255.255.255.0
Router-A_config_f0/3#no shutdown
步骤4:配置Router-B的名称及其接口IP地址。
Router_config#hostname Router-B
Router-B_config#interface Fastethernet 0/0
Router-B_config_f0/0#ip address 192.168.1.2 255.255.255.0
Router-B_config_f0/0#no shutdown
Router-B_config#interface Fastethernet 0/3
Router-B_config_f0/3#ip address 192.168.20.1 255.255.255.0
Router-B_config_f0/3#no shutdown
步骤5:查看Router-A的路由表。
Router-A#show ip route
VRF ID: 0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/3
步骤6:查看Router-B的路由表。
Router-B#show ip route
VRF ID: 0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/3
步骤7:配置路由协议前,验证网络的连通性。
- (1)在PC1上ping 192.168.20.2,网络不通
- (2)在PC2上ping 192.168.10.2,网络不通
步骤8:在Router-A上配置RIPv2协议。
Router-A_config#router rip 1 !启动RIP
Router-A_config_rip #version 2 !版本2
Router-A_config_rip #exit
Router-A_config# interface Fastethernet 0/0
Router-A_config_f0/0#ip rip 1 enable
Router-A_config_f0/0#exit
Router-A_config# interface Fastethernet 0/3
Router-A_config_f0/3#ip rip 1 enable
Router-A_config_f0/3#exit
步骤9:在Router-B上配置RIPv2协议。
Router-B _config#router rip 1 !启动RIP协议
Router-B_config_rip #version 2 !版本2
Router-B_config_rip #exit
Router-B_config# interface Fastethernet 0/0
Router-B_config_f0/0#ip rip 1 enable
Router-B_config_f0/0#exit
Router-B_config# interface Fastethernet 0/3
Router-B_config_f0/3#ip rip 1 enable
Router-B_config_f0/3#exit
步骤10:查看Router-A的路由表。
Router-A#show ip route
VRF ID: 0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/3
R 192.168.20.0/24 [120,1] via 192.168.1.2(on FastEthernet0/0)
! 从Router-B学习到的路由,类型为R。
步骤11:查看Router-B的路由表。
Router-B#show ip route
VRF ID: 0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/3
R 192.168.10.0/24 [120,1] via 192.168.1.1(on FastEthernet0/0)
! 从Router-A学习到的路由,类型为R。
步骤12:配置路由协议后,验证网络的连通性。
(1)在PC1上ping 192.168.20.2,网络已通
(2)在PC2上ping 192.168.10.2,网络已通