There is two upstream links and runs BGP on both. Since this router is low on RAM, it cannot accept
full routing, so it is just announcing it’s IP prefix and using static default routing toward upstream ISPs.

router bgp 65100
neighbor 10.0.1.2 remote-as 65001
neighbor 10.0.1.6 remote-as 65002
!
ip route 0.0.0.0 0.0.0.0 10.0.1.2
ip route 0.0.0.0 0.0.0.0 10.0.1.6 250

I’m sure the long-time readers of my blog immediately figured out where the catch is: if the upstream router
dies, but the interface stays up, the outbound traffic is blackholed.  Reliable static routing might be
a solution, but his router is running an old IOS version. Obviously it’s time for yet another rarely known
BGP feature: the BGP default route.

To announce a default route to a BGP neighbor, you can configure neighbor default-originate.
Once you’ve configured default route advertising with the neighbor default-originate, it’s announced to
the neighbor even if the router doesn’t have the default route itself.

The default route advertised to a BGP neighbor with the neighbor default-originate does not pass through
BGP output filters, so you cannot filter it.

To solve this problem, you’d have to reconfigure BGP on E1 and E2 as follows
(the ip as-path access list just ensures nothing else is sent to the customer router; obviously you could use a route-map instead) :

router bgp 65002
neighbor 10.0.1.5 remote-as 65100
neighbor 10.0.1.5 default-originate
neighbor 10.0.1.5 filter-list 1 out
!
ip as-path access-list 1 deny .*

Now that the default route is advertised via BGP, there is no need for a static default, and the default route
will be removed (and replaced with the backup one) if the BGP neighbor disappears.

Router Configuration :

GW
hostname GW
!
interface FastEthernet0/0
ip address 10.0.1.1 255.255.255.252
!
interface FastEthernet1/0
ip address 10.0.1.5 255.255.255.252
!
router bgp 65100
no synchronization
bgp log-neighbor-changes
neighbor 10.0.1.2 remote-as 65001
neighbor 10.0.1.6 remote-as 65002
neighbor 10.0.1.6 route-map WEIGHT in
no auto-summary
!
!
route-map WEIGHT permit 10
set weight 10

!
!

E1

hostname E1
!
interface FastEthernet0/0
ip address 10.0.1.2 255.255.255.252
!
!
router bgp 65001
no synchronization
bgp log-neighbor-changes
neighbor 10.0.1.1 remote-as 65100
neighbor 10.0.1.1 default-originate
neighbor 10.0.1.1 route-map PREFERENCE in
neighbor 10.0.1.1 filter-list 1 out
no auto-summary
!
!
ip as-path access-list 1 deny .*
!
route-map PREFERENCE permit 10
set local-preference 200

!
!

E2

hostname E2
!
interface FastEthernet0/0
ip address 10.0.1.6 255.255.255.252
!
router bgp 65002
no synchronization
bgp log-neighbor-changes
neighbor 10.0.1.5 remote-as 65100
neighbor 10.0.1.5 default-originate

 

Summary :

E1 router link will take preference since it has a preference value set within it’s
route-map of 200 – default is 100.

But on GW router we have set weight towards neighbor E2 of 5, default is 0, the
higher the weight will cause 
this link to take precedence. Weight will be outgoing
towards the router.

You either use weight or preference value, but not both.

Setting a preference value of 200 on E1 will cause incoming routes from GW router to be tagged with this value making E1 router the primary link.

Keep in mind if we have both Weight and Preference value set, then Weight will take
more preference since
it is outgoing towards it’s neighbor router.