Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#logging synchronous
R3(config-line)#exec-timeout 0 0
R3(config-line)#exit
网段配置
R3(config)#int f0/0
R3(config-if)#ip address 10.33.5.1 255.255.255.240
R3(config-if)#no shutdown
R3(config-if)#int f0/
*Mar 1 00:21:48.355: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
R3(config-if)#int f0/1
R3(config-if)#ip address 192.168.83.244 255.255.255.0
R3(config-if)#no shutdown
Ip配置
R5#show ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.12.195 YES manual up up
FastEthernet0/1 192.168.83.1 YES manual up up
Serial1/0 unassigned YES manual down down
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 192.168.12.65 YES manual up up
初始路由表
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.83.0/24 is directly connected, FastEthernet0/1
10.0.0.0/28 is subnetted, 1 subnets
C 10.33.5.0 is directly connected, FastEthernet0/0
R5#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
R7r#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 1 subnets
C 192.168.12.192 is directly connected, FastEthernet0/0
10.0.0.0/20 is subnetted, 1 subnets
C 10.33.32.0 is directly connected, FastEthernet0/1
启动rip1
R3(config)#router rip
R3(config-router)#version 1
R3(config-router)#network 10.33.5.0
R3(config-router)#network 192.168.83.0
R3(config-router)#exit
R5(config-router)#version 1
R5(config-router)#network 192.168.12.195
R5(config-router)#network 192.168.83.1
R5(config-router)#network 192.168.12.64
R5(config-router)#exit
R7(config)#router rip
R7(config-router)#version 1
R7(config-router)#network 192.168.12.195
R7(config-router)#network 10.33.32.0
R7(config-router)#exit
路由表
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 192.168.12.0/24 [120/1] via 192.168.83.1, 00:00:16, FastEthernet0/1
C 192.168.83.0/24 is directly connected, FastEthernet0/1
10.0.0.0/28 is subnetted, 1 subnets
C 10.33.5.0 is directly connected, FastEthernet0/0
2条直连路由 1条192.168.12.0的汇总路由(跨网段汇总了)
192.168.12.64 与 192.168.12.195 汇总成 192.168.12.0 主网段边界汇总
R5#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
R 10.0.0.0/8 [120/1] via 192.168.83.244, 00:00:27, FastEthernet0/1
[120/1] via 192.168.12.196, 00:00:11, FastEthernet0/0
3条直连 2条汇总
10.33.5.1/20 与 10.33.35.1/20 都跨网段汇总
R7#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 2 subnets
R 192.168.12.64 [120/1] via 192.168.12.195, 00:00:19, FastEthernet0/0
C 192.168.12.192 is directly connected, FastEthernet0/0
R 192.168.83.0/24 [120/1] via 192.168.12.195, 00:00:19, FastEthernet0/0
10.0.0.0/20 is subnetted, 1 subnets
C 10.33.32.0 is directly connected, FastEthernet0/1
设置R7的f0/0为被动接口 经过180s R5的路由表更新
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
R 10.0.0.0/8 [120/1] via 192.168.83.244, 00:00:10, FastEthernet0/1
[120/1] via 192.168.12.196, 00:03:05, FastEthernet0/0
R5#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
R 10.0.0.0/8 [120/1] via 192.168.83.244, 00:00:15, FastEthernet0/1
R5#
使用辅助地址解决子网不连续问题
R3上的第二地址 其他不配任何东西
interface FastEthernet0/1
ip address 10.33.55.1 255.255.240.0 secondary
ip address 192.168.83.244 255.255.255.0
*Mar 1 01:39:34.267: RIP: build update entries - suppressing null update
原因是因为 在对端接口没有对应的网段地址 所以 f0/1的第二地址起不来
在R5上的f0/1配置第二地址
R5路由表前后对比
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
R 10.0.0.0/8 [120/1] via 192.168.83.244, 00:00:27, FastEthernet0/1
[120/1] via 192.168.12.196, 00:00:11, FastEthernet0/0
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R 10.0.0.0/20 [120/1] via 192.168.83.244, 00:00:18, FastEthernet0/1
//如果是,接收方使用自己的接口上的掩码匹配路由更新
R 10.0.0.0/8 [120/1] via 192.168.83.244, 00:00:46, FastEthernet0/1
[120/1] via 192.168.12.196, 00:00:38, FastEthernet0/0
C 10.33.48.0/20 is directly connected, FastEthernet0/1
明显多了2条路由 但是发现没有发带掩码的地址 即是10.33.0.0/20的地址
原因 没有netwofk 第二网段 即 10.33.48.0 错误 //错误的解释
原因是配错了R3的F0/0网段的子网掩码
*Mar 1 02:23:17.603: RIP: build update entries
*Mar 1 02:23:17.603: subnet 10.33.0.0 metric 1
这时就会通告10.33.0.0这个子网
R5 的路由表
R5# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
10.0.0.0/20 is subnetted, 3 subnets //表示10.0.0.0下面有三个子网 列在下面
R 10.0.0.0 [120/1] via 192.168.83.244, 00:00:24, FastEthernet0/1
C 10.33.48.0 is directly connected, FastEthernet0/1
R 10.33.0.0 [120/1] via 10.33.55.1, 00:00:24, FastEthernet0/1
全部配完
192.168.12.0/27 is subnetted, 2 subnets
C 192.168.12.64 is directly connected, Loopback0
C 192.168.12.192 is directly connected, FastEthernet0/0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
10.0.0.0/20 is subnetted, 5 subnets
R 10.0.0.0 [120/1] via 192.168.83.244, 00:00:11, FastEthernet0/1
[120/1] via 192.168.12.196, 00:00:18, FastEthernet0/0
R 10.33.32.0 [120/1] via 10.33.75.2, 00:00:18, FastEthernet0/0
C 10.33.48.0 is directly connected, FastEthernet0/1
R 10.33.0.0 [120/1] via 10.33.55.1, 00:00:12, FastEthernet0/1
C 10.33.64.0 is directly connected, FastEthernet0/0
这时候删除R5的f0/1的第二id 查R5的路由表
C 192.168.12.64 is directly connected, Loopback0
C 192.168.83.0/24 is directly connected, FastEthernet0/1
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R 10.0.0.0/20 [120/1] via 192.168.83.244, 00:01:24, FastEthernet0/1
R 10.0.0.0/8 [120/1] via 192.168.83.244, 00:00:00, FastEthernet0/1
R 10.33.0.0/20 [120/1] via 10.33.55.1, 00:01:24, FastEthernet0/1
遇到的问题
Ip配置重复,倒置ping不同,改好后全网连通