R1 R2 R6組成外網使用ospf協議,R6迴環口1.1.1.1ide
R3爲出口路由器f0/0 和f1/0均可以訪問到1.1.1.1oop
R4 R5充當PC機器router
R6:配置server
interface Loopback0blog
ip address 1.1.1.1 255.255.255.255ip
!路由
interface FastEthernet0/0get
ip address 16.1.1.6 255.255.255.0it
duplex autoast
speed auto
!
interface FastEthernet1/0
ip address 26.1.1.6 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 16.1.1.0 0.0.0.255 area 0
network 26.1.1.0 0.0.0.255 area 0
!
R5 配置
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 192.168.2.1
R4配置
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 192.168.1.1
R3配置
SLA配置
ip sla monitor 1
type echo protocol ipIcmpEcho 13.1.1.1
ip sla monitor schedule 1 life forever start-time now
ip sla monitor 2
type echo protocol ipIcmpEcho 23.1.1.2
timeout 60000 這裏我延遲一分鐘切換
ip sla monitor schedule 2 life forever start-time now
定義跟蹤
track 123 rtr 1 reachability
track 124 rtr 2 reachability
interface FastEthernet0/0
ip address 13.1.1.3 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 23.1.1.3 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly
ip policy route-map 1
duplex auto
speed auto
!
interface FastEthernet3/0
ip address 192.168.2.1 255.255.255.0
ip nat inside
ip virtual-reassembly
ip policy route-map 1
duplex auto
speed auto
!
ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 13.1.1.1 track 123
ip route 0.0.0.0 0.0.0.0 23.1.1.2 track 124
!
!
ip nat inside source route-map 2 interface FastEthernet0/0 overload
ip nat inside source route-map 3 interface FastEthernet1/0 overload
ip nat inside source route-map 4 interface FastEthernet0/0 overload
ip nat inside source route-map 5 interface FastEthernet1/0 overload
!
ip access-list extended all-net
access-list 1 permit 192.168.1.0 0.0.0.255
access-list 2 permit 192.168.2.0 0.0.0.255
!
route-map 1 permit 10
match ip address 1
set ip next-hop verify-availability 13.1.1.1 1 track 123 (低級別路由器貌似不支持verify-availability )
set ip next-hop verify-availability 23.1.1.2 2 track 124
!
route-map 1 permit 20
match ip address 2
set ip next-hop verify-availability 23.1.1.2 1 track 124
set ip next-hop verify-availability 13.1.1.1 2 track 123
!
route-map 2 permit 10
match ip address 1
match ip next-hop 3
!
route-map 3 permit 10
match ip address 1
match ip next-hop 4
!
route-map 4 permit 10
match ip address 2
match ip next-hop 3
!
route-map 5 permit 10
match ip address 2
match ip next-hop 4
R2配置
interface FastEthernet0/0
ip address 26.1.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 23.1.1.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 23.1.1.0 0.0.0.255 area 0
network 26.1.1.0 0.0.0.255 area 0
R1配置
interface FastEthernet0/0
ip address 16.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 13.1.1.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 13.1.1.0 0.0.0.255 area 0
network 16.1.1.0 0.0.0.255 area 0