使用两种动态路由协议,并使两种协议间的路由可以传递
Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#interface gigabitEthernet 0/0
Ruijie(config-if-GigabitEthernet 0/0)#ip address 192.168.2.1 24
Ruijie(config-if-GigabitEthernet 0/0)#exit
Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#interface gigabitEthernet 0/0
Ruijie(config-if-GigabitEthernet 0/0)#ip address 192.168.2.2?24
Ruijie(config-if-GigabitEthernet 0/0)#exit
Ruijie(config)#interface gigabitEthernet 0/1
Ruijie(config-if-GigabitEthernet 0/1)#ip address 192.168.3.2?24
Ruijie(config-if-GigabitEthernet 0/1)#exit
Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#interface gigabitEthernet 0/0
Ruijie(config-if-GigabitEthernet 0/0)#ip address 192.168.4.1?24
Ruijie(config-if-GigabitEthernet 0/0)#exit
Ruijie(config)#interface gigabitEthernet 0/1
Ruijie(config-if-GigabitEthernet 0/1)#ip address 192.168.3.1?24
Ruijie(config-if-GigabitEthernet 0/1)#exit
Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#interface gigabitEthernet 0/0
Ruijie(config-if-GigabitEthernet 0/0)#ip address 192.168.4.2?24
Ruijie(config-if-GigabitEthernet 0/0)#exit
Ruijie(config)#route ospf
Ruijie(config-router)#network 192.168.2.0 0.0.0.255 area 0
Ruijie(config)#route ospf
Ruijie(config-router)#network 192.168.3.0 0.0.0.255 area 0
Ruijie(config-router)#network 192.168.2.0 0.0.0.255 area 0
Ruijie(config)#route ospf
Ruijie(config-router)#network 192.168.3.0 0.0.0.255 area 0
Ruijie(config)#route rip
Ruijie(config-router)#version 2
Ruijie(config-router)#network 192.168.4.0 255.255.255.0
Ruijie(config)#route rip
Ruijie(config-router)#version 2
Ruijie(config-router)#network 192.168.4.0 255.255.255.0
Ruijie(config)#route ospf
Ruijie(config-router)#redistribute rip metric-type 1 subnets?
Ruijie(config)#route rip?
Ruijie(config-router)#redistribute ospf 1 metric 1
在R1上查看路由表,可以看到已经学习到类型1的192.168.4.0的路由