要求:
以XA1与BG-A之间的线路为例:XA1与BG-A之间的线路故障时 xa1的生产流量由CD-B中转再到上平面,经过上平面访问DG,返回流量也先经过上平面再经CD-B返回XA。
正常情况下
XA
XA1与BG-A之间的线路断掉时
XA2与CD-B之间链路故障
XA1
interface Loopback0
ip address 10.100.1.1 255.255.255.255
ip ospf 1 area 0
!
interface Loopback1
ip address 10.200.1.1 255.255.255.255
ip ospf 1 area 0
!
interface Loopback3
ip address 100.0.0.1 255.255.255.255
ip ospf 1 area 0
!
interface Ethernet2/0
ip address 10.0.1.1 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 12.0.0.1 255.255.255.0
ip ospf 1 area 0
duplex half
!
router ospf 1
log-adjacency-changes
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 10.100.1.1 mask 255.255.255.255
network 10.100.2.2 mask 255.255.255.255
neighbor ibgp peer-group
neighbor ibgp remote-as 1
neighbor ibgp update-source Loopback3
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor 10.0.1.2 remote-as 2
neighbor 10.0.1.2 send-community both
neighbor 10.0.1.2 route-map xa1 out
neighbor 100.0.0.2 peer-group ibgp
neighbor 100.0.0.2 route-map dban in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:200
!
ip prefix-list ban seq 5 permit 10.200.0.0/16 le 32
!
ip prefix-list sheng seq 5 permit 10.100.0.0/16 le 32
route-map dban permit 10
match community 1
set weight 10
!
route-map dban permit 20
!
route-map xa1 permit 10
match ip address prefix-list sheng
set community 10:100
!
route-map xa1 permit 20
match ip address prefix-list ban
set community 10:200
!
route-map xa1 permit 30
!
XA2
interface Loopback0
ip address 10.100.2.2 255.255.255.255
ip ospf 1 area 0
!
interface Loopback1
ip address 10.200.2.2 255.255.255.255
ip ospf 1 area 0
!
interface Loopback3
ip address 100.0.0.2 255.255.255.255
ip ospf 1 area 0
!
interface Ethernet2/0
ip address 12.0.0.2 255.255.255.0
ip ospf 1 area 0
duplex half
!
interface Ethernet2/1
ip address 10.0.16.1 255.255.255.0
duplex half
router ospf 1
log-adjacency-changes
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 10.200.1.1 mask 255.255.255.255
network 10.200.2.2 mask 255.255.255.255
neighbor ibgp peer-group
neighbor ibgp remote-as 1
neighbor ibgp update-source Loopback3
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor 10.0.16.2 remote-as 3
neighbor 10.0.16.2 send-community both
neighbor 10.0.16.2 route-map xa2 out
neighbor 100.0.0.1 peer-group ibgp
neighbor 100.0.0.1 route-map dsheng in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:100
ip prefix-list ban seq 5 permit 10.200.0.0/16 le 32
!
ip prefix-list sheng seq 5 permit 10.100.0.0/16 le 32
!
route-map dsheng permit 10
match community 1
set weight 10
!
route-map dsheng permit 20
!
route-map xa2 permit 10
match ip address prefix-list sheng
set community 10:100
!
route-map xa2 permit 20
match ip address prefix-list ban
set community 10:200
!
route-map xa2 permit 30
!
BJ-A
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
!
interface Ethernet2/0
ip address 10.0.1.2 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.3.1 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.2.1 255.255.255.0
duplex half
!
interface Ethernet2/3
ip address 10.0.6.1 255.255.255.0
duplex half
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 10.0.2.0 0.0.0.255 area 0
network 10.0.3.0 0.0.0.255 area 0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 2
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map sheng in
neighbor 2.2.2.2 peer-group ibgp
neighbor 3.3.3.3 peer-group ibgp
neighbor 4.4.4.4 peer-group ibgp
neighbor 10.0.1.1 remote-as 1
neighbor 10.0.1.1 send-community both
neighbor 10.0.1.1 route-map xsheng in
neighbor 10.0.6.2 remote-as 3
neighbor 10.0.6.2 send-community both
neighbor 10.0.6.2 route-map dban in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:100
ip community-list 2 permit 10:100
ip community-list 3 permit 20:200
!
route-map dban permit 10
match community 3
set weight 10
!
route-map dban permit 20
!
route-map xsheng permit 10
match community 2
set weight 20
!
route-map xsheng permit 20
!
route-map sheng permit 10
match community 2 1
set weight 10
!
route-map sheng permit 20
!
SZ-A
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Ethernet2/0
ip address 10.0.2.2 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.5.1 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.8.1 255.255.255.0
duplex half
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 10.0.2.0 0.0.0.255 area 0
network 10.0.5.0 0.0.0.255 area 0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 2
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map sheng in
neighbor 1.1.1.1 peer-group ibgp
neighbor 3.3.3.3 peer-group ibgp
neighbor 4.4.4.4 peer-group ibgp
neighbor 10.0.8.2 remote-as 3
neighbor 10.0.8.2 send-community both
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:100
ip community-list 2 permit 10:100
!
route-map sheng permit 10
match community 2 1
set weight 10
!
route-map sheng permit 20
!
SH-A
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Ethernet2/0
ip address 10.0.4.1 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.5.2 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.9.1 255.255.255.0
duplex half
!
interface Ethernet2/3
ip address 10.0.14.1 255.255.255.0
duplex half
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 10.0.4.0 0.0.0.255 area 0
network 10.0.5.0 0.0.0.255 area 0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 2
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map sheng in
neighbor 1.1.1.1 peer-group ibgp
neighbor 2.2.2.2 peer-group ibgp
neighbor 4.4.4.4 peer-group ibgp
neighbor 10.0.9.2 remote-as 3
neighbor 10.0.9.2 send-community both
neighbor 10.0.9.2 route-map xban in
neighbor 10.0.14.2 remote-as 4
neighbor 10.0.14.2 send-community both
neighbor 10.0.14.2 route-map dsheng in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:100
ip community-list 2 permit 10:100
ip community-list 3 permit 10:200
!
route-map dsheng permit 10
match community 1
set weight 20
!
route-map dsheng permit 20
!
route-map xban permit 10
match community 3
set weight 10
!
route-map xban permit 20
!
route-map sheng permit 10
match community 2 1
set weight 10
!
route-map sheng permit 20
!
CD-A
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
!
interface Ethernet2/0
ip address 10.0.4.2 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.3.2 255.255.255.0
duplex half
!
interface Ethernet2/3
ip address 10.0.7.1 255.255.255.0
duplex half
!
!
router ospf 1
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 10.0.3.0 0.0.0.255 area 0
network 10.0.4.0 0.0.0.255 area 0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 2
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map sheng in
neighbor 1.1.1.1 peer-group ibgp
neighbor 2.2.2.2 peer-group ibgp
neighbor 3.3.3.3 peer-group ibgp
neighbor 10.0.7.2 remote-as 3
neighbor 10.0.7.2 send-community both
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:100
ip community-list 2 permit 10:100
!
route-map sheng permit 10
match community 2 1
set weight 10
!
route-map sheng permit 20
!
BJ-B
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Ethernet2/0
ip address 10.0.6.2 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.11.1 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.10.1 255.255.255.0
duplex half
!
router ospf 1
router-id 5.5.5.5
log-adjacency-changes
network 5.5.5.5 0.0.0.0 area 0
network 10.0.10.0 0.0.0.255 area 0
network 10.0.11.0 0.0.0.255 area 0
!
router bgp 3
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 3
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map ban in
neighbor 6.6.6.6 peer-group ibgp
neighbor 7.7.7.7 peer-group ibgp
neighbor 8.8.8.8 peer-group ibgp
neighbor 10.0.6.1 remote-as 2
neighbor 10.0.6.1 send-community both
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:200
ip community-list 2 permit 10:200
route-map ban permit 10
match community 2 1
set weight 10
!
route-map ban permit 20
!
!
SZ-B
interface Loopback0
ip address 7.7.7.7 255.255.255.0
!
interface Ethernet2/0
ip address 10.0.15.1 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.13.1 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.10.2 255.255.255.0
duplex half
!
interface Ethernet2/3
ip address 10.0.8.2 255.255.255.0
duplex half
!
router ospf 1
router-id 7.7.7.7
log-adjacency-changes
network 7.7.7.7 0.0.0.0 area 0
network 10.0.10.0 0.0.0.255 area 0
network 10.0.13.0 0.0.0.255 area 0
!
router bgp 3
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 3
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map ban in
neighbor 5.5.5.5 peer-group ibgp
neighbor 6.6.6.6 peer-group ibgp
neighbor 8.8.8.8 peer-group ibgp
neighbor 10.0.8.1 remote-as 2
neighbor 10.0.8.1 send-community both
neighbor 10.0.8.1 route-map xsheng in
neighbor 10.0.15.2 remote-as 4
neighbor 10.0.15.2 send-community both
neighbor 10.0.15.2 route-map dban in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:200
ip community-list 2 permit 10:200
ip community-list 3 permit 10:100
!
route-map dban permit 10
match community 1
set weight 20
!
route-map dban permit 20
!
route-map xsheng permit 10
match community 3
set weight 10
!
route-map xsheng permit 20
!
route-map ban permit 10
match community 2 1
set weight 10
!
route-map ban permit 20
!
SH-B
!
interface Loopback0
ip address 8.8.8.8 255.255.255.255
!
interface Ethernet2/0
ip address 10.0.12.2 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.13.2 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.9.2 255.255.255.0
duplex half
!
router ospf 1
router-id 8.8.8.8
log-adjacency-changes
network 8.8.8.8 0.0.0.0 area 0
network 10.0.12.0 0.0.0.255 area 0
network 10.0.13.0 0.0.0.255 area 0
!
router bgp 3
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 3
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map ban in
neighbor 5.5.5.5 peer-group ibgp
neighbor 6.6.6.6 peer-group ibgp
neighbor 7.7.7.7 peer-group ibgp
neighbor 10.0.9.1 remote-as 2
neighbor 10.0.9.1 send-community both
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:200
ip community-list 2 permit 10:200
route-map ban permit 10
match community 2 1
set weight 10
!
route-map ban permit 20
!
CD-B
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface Ethernet2/0
ip address 10.0.12.1 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 10.0.11.2 255.255.255.0
duplex half
!
interface Ethernet2/2
ip address 10.0.16.2 255.255.255.0
duplex half
!
interface Ethernet2/3
ip address 10.0.7.2 255.255.255.0
duplex half
!
router ospf 1
router-id 6.6.6.6
log-adjacency-changes
network 6.6.6.6 0.0.0.0 area 0
network 10.0.11.0 0.0.0.255 area 0
network 10.0.12.0 0.0.0.255 area 0
!
router bgp 3
no synchronization
bgp log-neighbor-changes
neighbor ibgp peer-group
neighbor ibgp remote-as 3
neighbor ibgp update-source Loopback0
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor ibgp route-map ban in
neighbor 5.5.5.5 peer-group ibgp
neighbor 7.7.7.7 peer-group ibgp
neighbor 8.8.8.8 peer-group ibgp
neighbor 10.0.7.1 remote-as 2
neighbor 10.0.7.1 send-community both
neighbor 10.0.7.1 route-map dsheng in
neighbor 10.0.16.1 remote-as 1
neighbor 10.0.16.1 send-community both
neighbor 10.0.16.1 route-map xban in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 20:200
ip community-list 2 permit 10:200
ip community-list 3 permit 20:100
!
route-map dsheng permit 10
match community 3
set weight 10
!
route-map dsheng permit 20
!
route-map xban permit 10
match community 2
set weight 20
!
route-map xban permit 20
!
route-map ban permit 10
match community 2 1
set weight 10
!
route-map ban permit 20
!
DG1
!
interface Loopback0
ip address 20.100.1.1 255.255.255.255
ip ospf 1 area 0
!
interface Loopback1
ip address 20.200.1.1 255.255.255.255
ip ospf 1 area 0
!
interface Loopback3
ip address 200.0.0.1 255.255.255.255
ip ospf 1 area 0
!
speed auto
!
interface Ethernet2/0
ip address 10.0.14.2 255.255.255.0
duplex half
!
interface Ethernet2/1
ip address 23.0.0.1 255.255.255.0
ip ospf 1 area 0
duplex half
!
router ospf 1
log-adjacency-changes
!
router bgp 4
no synchronization
bgp log-neighbor-changes
network 20.100.1.1 mask 255.255.255.255
network 20.100.2.2 mask 255.255.255.255
neighbor ibgp peer-group
neighbor ibgp remote-as 4
neighbor ibgp update-source Loopback3
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor 10.0.14.1 remote-as 2
neighbor 10.0.14.1 send-community both
neighbor 10.0.14.1 route-map dg1 out
neighbor 200.0.0.2 peer-group ibgp
neighbor 200.0.0.2 route-map xban in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 10:200
ip prefix-list ban seq 5 permit 20.200.0.0/16 le 32
!
ip prefix-list sheng seq 5 permit 20.100.0.0/16 le 32
route-map xban permit 10
match community 1
set weight 10
!
route-map xban permit 20
!
route-map dg1 permit 10
match ip address prefix-list sheng
set community 20:100
!
route-map dg1 permit 20
match ip address prefix-list ban
set community 20:200
!
route-map dg1 permit 30
!
DG2
!
interface Loopback0
ip address 20.100.2.2 255.255.255.255
ip ospf 1 area 0
!
interface Loopback1
ip address 20.200.2.2 255.255.255.255
ip ospf 1 area 0
!
interface Loopback3
ip address 200.0.0.2 255.255.255.255
ip ospf 1 area 0
!
!
interface Ethernet2/0
ip address 23.0.0.2 255.255.255.0
ip ospf 1 area 0
duplex half
!
interface Ethernet2/1
ip address 10.0.15.2 255.255.255.0
duplex half
!
!
router ospf 1
log-adjacency-changes
!
router bgp 4
no synchronization
bgp log-neighbor-changes
network 20.200.1.1 mask 255.255.255.255
network 20.200.2.2 mask 255.255.255.255
neighbor ibgp peer-group
neighbor ibgp remote-as 4
neighbor ibgp update-source Loopback3
neighbor ibgp next-hop-self
neighbor ibgp send-community both
neighbor 10.0.15.1 remote-as 3
neighbor 10.0.15.1 send-community both
neighbor 10.0.15.1 route-map dg2 out
neighbor 200.0.0.1 peer-group ibgp
neighbor 200.0.0.1 route-map xsheng in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip bgp-community new-format
ip community-list 1 permit 10:100
!
ip prefix-list ban seq 5 permit 20.200.0.0/16 le 32
!
ip prefix-list sheng seq 5 permit 20.100.0.0/16 le 32
route-map xsheng permit 10
match community 1
set weight 10
!
route-map xsheng permit 20
!
route-map dg2 permit 10
match ip address prefix-list sheng
set community 20:100
!
route-map dg2 permit 20
match ip address prefix-list ban
set community 20:200
!
route-map dg2 permit 30