You can configure route map that matches on a static network.
device# configure terminal
device(config)# route-map mystaticroutemap3 permit 1
device(config-routemap-mystaticroutemap3/permit/1)# match protocol bgp static-network
device(config-routemap-mystaticroutemap3/permit/1)# set local-preference 150
device(config-routemap-mystaticroutemap3/permit/1)# set community no-export
device(config-routemap-mystaticroutemap3/permit/1)# exit
device(config)# router bgp
device(config-bgp-router)# address-family ipv4 unicast
device (config-bgp-ipv4u)# neighbor 10.1.2.3 route-map out mystaticroutemap3
The following example summarizes the commands in this procedure.
device# configure terminal device(config)# route-map mystaticroutemap3 permit 1 device(config-routemap-mystaticroutemap3/permit/1)# match protocol bgp static-network device(config-routemap-mystaticroutemap3/permit/1)# set local-preference 150 device(config-routemap-mystaticroutemap3/permit/1)# set community no-export device(config-routemap-mystaticroutemap3/permit/1)# exit device(config)# router bgp device(config-bgp)# address-family ipv4 unicast device(config-bgp-ipv4u)# neighbor 10.1.2.3 route-map out mystaticroutemap3