If you're running BGP with two ISPs and we don't want that the 2 providers to use our nework as transit, we have to be sure that the routes originating from one ISP don't transit up to the other ISP. The two ISPs dont have to see each other through our network
The routes must come in from the ISPs, but we dont have to advertise routes from ISP 1 to ISP2.
We can do this using ip as-path access-list and regular expressions:
R1(config)#ip as-path access-list 1 deny _300_ (if 300 is in the as-path will be dropped)
R1(config)#ip as-path access-list 1 permit .* (allow everything else)
R1(config)#router-map FILTER-AS300 permit 10
R1(config)#match as-path 1
R1(config)#router bgp 500
R1(config)#neighbor 1.1.1.1 route-map FILTER-AS300 out
R1(config)# do clear ip bgp *