拓扑图:
ip address table:
Device | Interface | IP Address | Subnet Mask | Default Gateway |
R1 | G0/1 | 172.18.10.1 | 255.255.255.0 | N/A |
S0/0/0 (DCE) | 172.18.12.1 | 255.255.255.252 | N/A | |
R2 | G0/0 | 209.165.201.1 | 255.255.255.0 | N/A |
S0/0/0 | 172.18.12.2 | 255.255.255.252 | N/A | |
S0/0/1 (DCE) | 172.18.23.1 | 255.255.255.252 | N/A | |
R3 | G0/1 | 172.18.30.1 | 255.255.255.0 | N/A |
S0/0/1 | 172.18.23.2 | 255.255.255.252 | N/A | |
S1 | VLAN 1 | 172.18.10.11 | 255.255.255.0 | 172.18.10.1 |
S3 | VLAN 1 | 172.18.30.33 | 255.255.255.0 | 172.18.30.1 |
PC-A | NIC | 172.18.10.10 | 255.255.255.0 | 172.18.10.1 |
PC-B | NIC | 209.165.201.2 | 255.255.255.0 | 209.165.201.1 |
PC-C | NIC | 172.18.30.30 | 255.255.255.0 | 172.18.30.1 |
Part1: Build the Network and Configure Basic Device Settings
方法及命令在上一篇博客中有详细介绍:
(4条消息) Cisco Lab – Configuring Dynamic Routing with RIPv2_Ceaserheavn的博客-CSDN博客
补充命令:
(1)清楚某一个接口的ip地址:先进入该接口,然后no ip address
另外,如果接口配置了其他与IP地址相关的配置,例如:ip default-gateway
ip access-group
ip nat
等,在删除ip address配置后,最好也一并删除这些相关配置,避免产生未知影响。所以,一个接口IP地址配置的完整清除过程可以是:interface GigabitEthernet 0/0
no ip address
no ip default-gateway
no ip access-group
no ip nat
//删除其他IP相关配置
exit
重新进入接口视图后,使用show ip interface brief命令可以确认接口IP地址配置已经完全删除。
(2)配置默认网关:ip default-gateway {ip address}
如:R1(config-if)#int g0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#ip default-gateway 192.168.1.254
Part2: Configure and Verify RIPv2 Routing
Step1: Configure RIPv2 Routing on all Routers.
(以R1为例)
R1(config)#router rip
R1(config-router)# version 2
Step2: Advertise the appropriate networks (Do not send routing updates to LANs)
R1(config-router)#passive-interface g0/1
R1(config-router)#passive-interface s0/0/0
R1(config-router)# network 172.18.0.0
R1(config-router)# network 172.18.0.0
Step3: Disable Auto-Summarisation on all RIP routing.
R1(config-router)#no auto-summary
Step4:Configure and redistribute a default route for Internet access.
R1(config-router)#ip route 0.0.0.0 0.0.0.0 {next_hop_ip}
即R1(config-router)#ip route 0.0.0.0 0 0.0.0.0 172.18.10.11
或者 default-information originate(推荐)
Step5: Verify the routing configuration.
要验证路由器的路由配置,可以使用以下命令:
1. show ip route此命令显示路由器的路由表,可以查看已学习的网络和下一跳信息,验证路由配置是否正确。
2. show ip protocols此命令显示路由器启用的路由协议的信息,包括相关的参数配置,可以验证路由协议配置是否正确。
3. show ip ospf neighbor(若使用OSPF协议)此命令显示OSPF邻居的相关信息,可以验证OSPF邻居关系是否建立。
4. show ip bgp neighbors(若使用BGP协议)此命令显示BGP邻居的相关信息,可以验证BGP邻居关系是否建立。
5. ping使用ping命令,指定不同的目的地址,验证是否可以正确访问各个网络和主机。
6. traceroute使用traceroute命令,指定不同的目的地址,跟踪数据包的路由路径,验证转发路径是否正确。
以上命令可以全面验证路由器的路由配置情况,包括:
- 路由表学习情况
- 路由协议运行情况
- 邻居关系是否建立
- 各个网络和主机是否可以访问
- 数据包转发路径是否正确如果发现任何问题,需要根据显示信息进一步检查和修订路由器的配置。Step6: Verify connectivity.
Questions
1.Enter the command used to view the routing table of each router?
R2#show ip route
2.How many RIP route entries are listed in router R2’s routing table?
0
3.List all the learned routes in router R1’s table:
172.18.12.0;
172.18.12.2
172.18.23.0
172.18.23.1
209.165.201.0
209.165.201.1
0.0.0.0
4.How did routers R1 and R3 learn the pathway to the internet?
RIP order makes R1 R2 learn the pathway to the internet
5.How did routers R1 and R3 learn about each other’s private LAN networks?
They can use the dynamic routing protocol to learn