主用路由器
R01#show run
Building Configuration...done
! Current configuration : 2143 bytes
!
! No configuration change since last restart
! Configuration version 0.8
!
!software version 6.1.94(NAT)(integrity)
!software p_w_picpath file flash0: /flash/rp8-i-6.1.94(NAT).bin
!compiled on Apr 8 2010, 15:51:29
hostname R01
service password-encrypt
no service new-encrypt
service login-secure
enable password QWWWQXQW]W encrypt
ip mef //快速转发
ip load-sharing per-destination //数据包基于目标网络进行转发
ip access-list standard 99 //允许telnet到该路由器的合法IP地址段           
 10 permit host 30.192.14.1
 20 permit host 30.192.14.2
 30 permit host 30.192.14.3
 40 permit host 30.192.14.4
 50 permit 30.192.64.0 0.0.0.255
 60 permit 30.192.250.0 0.0.0.255
 70 permit 30.192.251.0 0.0.0.255
 80 permit 30.197.128.0 0.0.127.255
 exit
 
link-aggregation 1 //主备路由器之间的互连线,与备用路由器22,23端口互联
 port 22-23
 exit
vlan 1   // vlan 1包含端口0-23 
 description HLVLAN
 port 0-23 untagged
 exit
           
interface loopback0  //loopback0 IP地址
 ip address 30.197.177.251 255.255.255.255
 exit
interface fastethernet0 //上联到市的接口IP
 
 description TO DR01 G2.18
 ip address 30.197.156.70 255.255.255.252
 rate-limit input 2000000 8000 16000 conform-action transmit exceed-action drop
 rate-limit output 2000000 8000 16000 conform-action transmit exceed-action drop
 ip ospf cost 300
 ip ospf network point-to-point
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 7 PVWV^VRWOWUV
 exit
 
interface fastethernet1
 exit
interface switchethernet0 //本地接口地址
 ip address 30.197.177.1 255.255.255.128           
 bandwidth 10000  //cost值为10
 vlan 1
 ip ospf network point-to-point
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 7 PVWV^VRWOWUV
 vrrp 1 ip 30.197.177.3
//启用VRRP协议,当主用路由器fastethernet0 down或ospf neighbor无法建立时,通过互连线迅速切换到备用路由器
 vrrp 1 preempt
 vrrp 1 priority 120
 exit
interface null0
 exit
router ospf 30
 router-id 30.197.177.251
 network 30.197.156.70 0.0.0.0 area 564
 network 30.197.177.0 0.0.0.255 area 564
 area 564 authentication message-digest
 exit
line con 0
 exec-timeout 2 0
 password 7 QWWWQXQW]W
 login
 
line vty 0 4
 access-class 99 in
 exec-timeout 2 0
 password 7 QWWWQXQW]W
 login
 exit
 
snmp-server start 
snmp-server view default 1.3.6.1 include
snmp-server community ahwlk view default ro
snmp-server community wlk509wh view default rw
!end
R01#
备用路由器
R02#
show run
Building Configuration...done
! Current configuration : 2124 bytes
!
! No configuration change since last restart
! Configuration version 0.3
!
!software version 6.1.94(NAT)(integrity)
!software p_w_picpath file flash0: /flash/rp8-i-6.1.94(NAT).bin
!compiled on Apr 8 2010, 15:51:29
hostname R02
service password-encrypt
no service new-encrypt
service login-secure
enable password QWWWQXQW]W encrypt
ip mef
ip load-sharing per-destination
ip access-list standard 99         
 10 permit host 30.192.14.1        
 20 permit host 30.192.14.2         
 30 permit host 30.192.14.3
 40 permit host 30.192.14.4            
 50 permit 30.192.64.0 0.0.0.255
 60 permit 30.192.250.0 0.0.0.255
 70 permit 30.192.251.0 0.0.0.255
 80 permit 30.197.128.0 0.0.127.255
 exit
 
link-aggregation 1
 port 22-23
 exit
 
vlan 1
 description HLVLAN
 port 0-23 untagged
 exit
 
interface loopback0
 ip address 30.197.177.252 255.255.255.255
 exit
interface fastethernet0
 description TO DR02 G2.18
 ip address 30.197.157.70 255.255.255.252
 rate-limit input 2000000 8000 16000 conform-action transmit exceed-action drop
 rate-limit output 2000000 8000 16000 conform-action transmit exceed-action drop
 ip ospf cost 300
 ip ospf network point-to-point
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 7 PVWV^VRWOWUV
 exit
interface fastethernet1
 exit
interface switchethernet0
 ip address 30.197.177.2 255.255.255.128
 vlan 1
 ip ospf cost 300
 ip ospf network point-to-point
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 7 PVWV^VRWOWUV
 vrrp 1 ip 30.197.177.3
 vrrp 1 preempt
 vrrp 1 priority 110
 exit
interface null0
 exit
                                     
router ospf 30
 router-id 30.197.177.252
 network 30.197.157.70 0.0.0.0 area 564
 network 30.197.177.0 0.0.0.255 area 564
 area 564 authentication message-digest
 exit
line con 0
 password 7 QWWWQXQW]W
 login
           
line vty 0 4
 access-class 99 in
 exec-timeout 2 0
 password 7 QWWWQXQW]W
 login
 exit
snmp-server start 
snmp-server view default 1.3.6.1 include
snmp-server community public view default ro
snmp-server community ahwlk view default ro
!end
R02#