配置参数
R1配置
IP配置参数
interface GigabitEthernet0/0/0
ip address 10.0.0.1 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 172.16.31.1 255.255.255.252
#
interface GigabitEthernet0/0/2
ip address 10.0.0.5 255.255.255.252
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface LoopBack1
ip address 192.130.1.1 255.255.255.0
#
ospf 1 router-id 1.1.1.1
import-route direct #导入直连路由
import-route static #导入静态路由
area 0.0.0.0
network 1.0.0.0 0.255.255.255
network 192.130.1.0 0.0.0.255
network 10.0.0.0 0.255.255.255
area 0.0.0.1
network 10.0.0.5 0.0.0.0
静态参数
ip route-static 0.0.0.0 0.0.0.0 172.16.31.2
ip route-static 59.56.61.0 255.255.255.0 172.16.31.2
R2配置
interface GigabitEthernet0/0/0
ip address 10.0.0.2 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 192.130.100.1 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf配置参数
ospf 1 router-id 2.2.2.2
import-route direct
import-route static
import-route rip 1 #导入动态路由
area 0.0.0.0
network 2.0.0.0 0.255.255.255
network 10.0.0.0 0.255.255.255
动态配置参数
rip 1
undo summary
version 2
network 192.130.100.0
network 2.0.0.0
import-route ospf 1 #导入ospf 1
R3配置
interface GigabitEthernet0/0/0
ip address 10.0.0.6 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 10.0.0.9 255.255.255.252
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
ospf配置参数
ospf 1 router-id 3.3.3.3
import-route direct
import-route static
area 0.0.0.1
network 3.0.0.0 0.255.255.255
network 10.0.0.6 0.0.0.0
静态地址
ip route-static 4.0.0.0 255.0.0.0 10.0.0.10
ip route-static 192.130.3.0 255.255.255.0 10.0.0.10
R4配置
IP配置参数
interface GigabitEthernet0/0/0
ip address 10.0.0.10 255.255.255.252
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
interface LoopBack1
ip address 192.130.3.1 255.255.255.0
#
静态参数
ip route-static 0.0.0.0 0.0.0.0 10.0.0.9
ip route-static 3.0.0.0 255.0.0.0 10.0.0.9
R5配置
interface GigabitEthernet0/0/0
ip address 192.130.100.2 255.255.255.0
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
#
interface LoopBack1
ip address 192.130.2.1 255.255.255.0
Rip配置参数
rip 1
undo summary #关闭使能路由聚合
version 2 #指定RIP版本号
network 5.0.0.0
network 192.130.2.0
network 192.130.100.0
import-route ospf 1
ISP配置
IP配置参数
interface GigabitEthernet0/0/0
ip address 172.16.31.2 255.255.255.252
#
interface LoopBack1
ip address 59.56.61.1 255.255.255.0
静态参数
ip route-static 0.0.0.0 0.0.0.0 172.16.31.1
ip route-static 1.0.0.0 255.0.0.0 172.16.31.1
ip route-static 192.130.1.0 255.255.255.0 172.16.31.1
需要注意事项
1.ospf需要导入静态、动态,动态也要导入ospf才能互通,静态不需要导入。