Good evening, I'm Lao Yang.
Yesterday, I shared a tool Amway " Sharing 6 Network Latency Test Tools, All of which are Essential Goods for Veteran Internet Workers ". Many friends said that they are very dry, and Lao Yang is very happy to receive this kind of feedback.
Today we talk about technology as usual, and talk about things we haven't talked about, such as routing redistribution.
We all know that a network contains two areas, and each area uses its own dynamic routing protocol.
If at this time, you want to achieve network intercommunication between the two areas, you need to open a route between the two.
However, these two dynamic routing protocols are different protocols after all, and the routing information is completely isolated. How do they achieve interaction?
Edit toggle to center
Add picture annotations, no more than 140 words (optional)
This requires the use of route redistribution (route import route-importation).
In order to realize the collaborative work of multiple routing protocols, routers can use route redistribution to broadcast the routes learned by one routing protocol through another routing protocol. In this way, all parts of the network can be connected.
In order to implement redistribution, the router must run multiple routing protocols at the same time, so that each routing protocol can take all or part of the routes of other protocols in the routing table for broadcast.
Then how to configure? Today I sorted out all the operation details and arranged them.
If you want to learn the system foundation related to OSPF and routing, it is actually very simple. The elementary courses of manufacturer certification are all involved, the logic is complete, the thinking is clear, and it also cooperates with actual combat.
edit
Add picture annotations, no more than 140 words (optional)
Routing redistribution, in the end how to adjust?
The topology diagram is as follows:
Edit toggle to center
Add picture annotations, no more than 140 words (optional)
illustrate
To realize the communication of the whole network, in reality, NAT needs to be done on R1 to realize the communication with the ISP.
In this case, the configuration of NAT is omitted, and the default route is configured on the ISP router to achieve communication. In addition, OSPF (RIP) redistribution and redistribution of static routes and direct routes need to be configured on R2 and R3, so as to realize the intercommunication of the entire network. The specific configuration is as follows:
(1) Configure each router, as well as OSPF protocol, RIP protocol, static routing, and interface IP address
The configuration of R1 is as follows:
interface address
R1#conf t
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/0
R1(config-if)#ip add 10.0.0.5 255.255.255.252
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/1
R1(config-if)#ip add 172.16.31.1 255.255.255.252
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/2
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int e0/3
R1(config-if)#ip add 10.0.0.1 255.255.255.252
R1(config-if)#no sh
R1(config-if)#exit
OSPF protocol
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 10.0.0.0 0.0.0.3 area 0
R1(config-router)#network 10.0.0.4 0.0.0.3 area 1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#exit
default route
R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.31.2
The configuration of R2 is as follows:
interface address
R2#conf t
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int e0/0
R2(config-if)#ip add 10.0.0.2 255.255.255.252
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int e0/1
R2(config-if)#ip add 192.168.100.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
OSPF protocol
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 10.0.0.0 0.0.0.3 area 0
R2(config-router)#exit
RIP protocol
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.100.0
R2(config-router)#exit
The configuration of R3 is as follows:
interface address
R3#conf t
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int e0/0
R3(config-if)#ip add 10.0.0.6 255.255.255.252
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int e0/1
R3(config-if)#ip add 10.0.0.9 255.255.255.252
R3(config-if)#no sh
R3(config-if)#exit
OSPF protocol
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 3.3.3.3 0.0.0.0 area 1
R3(config-router)#network 10.0.0.4 0.0.0.3 area 1
R3(config-router)#exit
static route
R3(config)#ip route 192.168.3.0 255.255.255.0 10.0.0.10
The configuration of R4 is as follows:
interface address
R4#conf t
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int e0/0
R4(config-if)#ip add 192.168.3.1 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#int e0/1
R4(config-if)#ip add 10.0.0.10 255.255.255.252
R4(config-if)#no sh
R4(config-if)#exit
default route
R4(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.9
The configuration of R5 is as follows:
interface address
R5#conf t
R5(config)#int e0/0
R5(config-if)#ip add 192.168.2.1 255.255.255.0
R5(config-if)#no sh
R5(config-if)#int e0/1
R5(config-if)#ip add 192.168.100.2 255.255.255.0
R5(config-if)#no sh
R5(config-if)#exit
RIP protocol
R5(config)#router rip
R5(config-router)#version 2
R5(config-router)#network 192.168.100.0
R5(config-router)#network 192.168.2.0
R5(config-router)#exit
The configuration of the ISP is as follows:
interface address
ISP#conf t
ISP(config)#int e0/0
ISP(config-if)#ip add 59.56.61.1 255.255.255.0
ISP(config-if)#no sh
ISP(config-if)#exit
ISP(config)#int e0/1
ISP(config-if)#ip add 172.16.31.2 255.255.255.252
ISP(config-if)#no sh
ISP(config-if)#exit
default route
ISP(config)#ip route 0.0.0.0 0.0.0.0 172.16.31.1
(2) Configure route redistribution
Redistributing the default route on R1, the configuration is as follows:
R1(config)#router ospf 1
R1(config-router)#default-information originate
R1(config-router)#exit
Redistribute OSPF and RIP on R2, the configuration is as follows:
R2(config)#router ospf 1
R2(config-router)#redistribute rip subnets
R2(config-router)#exit
R2(config)#router rip
R2(config-router)#redistribute ospf 1 metric 3
R2(config-router)#exit
Redistributing static routes and direct routes on R3, the configuration is as follows:
R3(config)#router ospf 1
R3(config-router)#redistribute static subnets
R3(config-router)#redistribute connected subnets
R3(config-router)#exit
(3) Verify that the network communication is normal
Check the routing tables of R1, R2, R3, and R5, and use the ping command to verify whether the network communication is normal.
Routing table of R1:
R1#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 172.16.31.2 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 10.0.0.2, 02:41:47, Ethernet0/3
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 10.0.0.6, 02:39:45, Ethernet0/0
172.16.0.0/30 is subnetted, 1 subnets
C 172.16.31.0 is directly connected, Ethernet0/1
10.0.0.0/30 is subnetted, 3 subnets
O E2 10.0.0.8 [110/20] via 10.0.0.6, 02:39:39, Ethernet0/0
C 10.0.0.0 is directly connected, Ethernet0/3
C 10.0.0.4 is directly connected, Ethernet0/0
C 192.168.1.0/24 is directly connected, Ethernet0/2
O E2 192.168.2.0/24 [110/20] via 10.0.0.2, 02:40:07, Ethernet0/3
O E2 192.168.100.0/24 [110/20] via 10.0.0.2, 02:40:07, Ethernet0/3
O E2 192.168.3.0/24 [110/20] via 10.0.0.6, 02:40:07, Ethernet0/0
S* 0.0.0.0/0 [1/0] via 172.16.31.2 (default route redistribution)
Routing table of R2:
R2#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 10.0.0.1 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/11] via 10.0.0.1, 02:42:10, Ethernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/21] via 10.0.0.1, 02:42:10, Ethernet0/0
10.0.0.0/30 is subnetted, 3 subnets
O E2 10.0.0.8 [110/20] via 10.0.0.1, 02:40:00, Ethernet0/0
C 10.0.0.0 is directly connected, Ethernet0/0
O IA 10.0.0.4 [110/20] via 10.0.0.1, 02:42:12, Ethernet0/0
O 192.168.1.0/24 [110/20] via 10.0.0.1, 02:42:12, Ethernet0/0
R 192.168.2.0/24 [120/1] via 192.168.100.2, 00:00:14, Ethernet0/1
C 192.168.100.0/24 is directly connected, Ethernet0/1
O E2 192.168.3.0/24 [110/20] via 10.0.0.1, 02:40:06, Ethernet0/0
O*E2 0.0.0.0/0 [110/1] via 10.0.0.1, 02:40:06, Ethernet0/0 (redistribution of RIP)
Routing table of R3:
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 10.0.0.5 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/11] via 10.0.0.5, 02:41:33, Ethernet0/0
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/21] via 10.0.0.5, 02:41:33, Ethernet0/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
10.0.0.0/30 is subnetted, 3 subnets
C 10.0.0.8 is directly connected, Ethernet0/1
O IA 10.0.0.0 [110/20] via 10.0.0.5, 02:41:33, Ethernet0/0
C 10.0.0.4 is directly connected, Ethernet0/0
O IA 192.168.1.0/24 [110/20] via 10.0.0.5, 02:41:35, Ethernet0/0
O E2 192.168.2.0/24 [110/20] via 10.0.0.5, 02:41:35, Ethernet0/0
O E2 192.168.100.0/24 [110/20] via 10.0.0.5, 02:41:35, Ethernet0/0
S 192.168.3.0/24 [1/0] via 10.0.0.10
O*E2 0.0.0.0/0 [110/1] via 10.0.0.5, 02:41:36, Ethernet0/0 (redistribution of static and directly connected routes)
Routing table of 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 192.168.100.1 to network 0.0.0.0
R 1.0.0.0/8 [120/3] via 192.168.100.1, 00:00:17, Ethernet0/1
R 2.0.0.0/8 [120/3] via 192.168.100.1, 00:00:17, Ethernet0/1
R 3.0.0.0/8 [120/3] via 192.168.100.1, 00:00:17, Ethernet0/1
R 10.0.0.0/8 [120/3] via 192.168.100.1, 00:00:17, Ethernet0/1
R 192.168.1.0/24 [120/3] via 192.168.100.1, 00:00:17, Ethernet0/1
C 192.168.2.0/24 is directly connected, Ethernet0/0
C 192.168.100.0/24 is directly connected, Ethernet0/1
R 192.168.3.0/24 [120/3] via 192.168.100.1, 00:00:19, Ethernet0/1
R* 0.0.0.0/0 [120/3] via 192.168.100.1, 00:00:19, Ethernet0/1 (OSPF redistribution)
Ping ISP and R5 on R4
R4#ping 59.56.61.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 59.56.61.1, timeout is 2 seconds:
!!!!!! (Able to communicate normally)
Success rate is 100 percent (5/5), round-trip min/avg/max = 84/99/120 ms
R4#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!! (Able to communicate normally)
Success rate is 100 percent (5/5), round-trip min/avg/max = 124/132/152 ms
Finishing: Lao Yang 丨 8-year senior network engineer , more network workers to improve dry goods, please pay attention to the official account: Network Engineer Club