R1配置:
interface Loopback1
ip address 1.1.1.1 255.255.255.255
!
interface Loopback2
ip address 1.1.2.1 255.255.255.255
!
interface Serial1/1
ip address 10.0.1.1 255.255.255.0
serial restart-delay 0
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 1.1.2.0 0.0.0.255 area 0
network 10.0.1.0 0.0.0.255 area 0
!
R2配置:
interface Loopback1
ip address 2.2.2.2 255.255.255.255
!
interface Serial1/0
ip address 10.0.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 10.0.2.1 255.255.255.0
serial restart-delay 0
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 10.0.1.0 0.0.0.255 area 0
default-information originate //生成一条默认路由下发到OSPF域中
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.2.2 //创建默认路由指向ISP
R3配置:
interface Loopback1
ip address 3.3.1.3 255.255.255.255
!
interface Loopback2
ip address 3.3.2.3 255.255.255.255
!
interface Loopback3
ip address 3.3.3.3 255.255.255.255
!
interface Serial1/0
ip address 10.0.2.2 255.255.255.0
serial restart-delay 0
!
ip route 10.0.1.0 255.255.255.0 10.0.2.1 //ISP提供商指回一条静态路由
转载于:https://blog.51cto.com/renzhongming/686660