I want to NAT traffic to only destinations that are recieved as BGP routes (Any BGP routes will do, not just a particular neighbour).
RTR1 has 3 connections, LAN1 (10.3.0.1/24) and 2 WAN connections with BGP peering on WAN1 connection for some specific 10.0.0.0/8 addresses in the form of /16 and /24 subnets. RTR1 then has a 10.0.0.0/8 route via the WAN2 connection for traffic not matching the BGP sourced subnets.
RTR2 has an IP in LAN1 (10.3.0.2/24 fa0/1) and an IP in LAN2 (10.3.11.1/24 fa0/0). RTR2 has 10.0.0.0/8 routed to 10.3.0.1 and it also has BGP peering with RTR1 to get the specific routes that use WAN1.
so it looks like this:
LAN2-> RTR2 -> LAN1 -> RTR1 -> WAN1 (with BGP)
-> WAN2 (static route)
Essentially I want to NAT traffic on RTR2 (coming from 10.3.11.0/24) going to the BGP sourced destinations. say for example 10.250.0.0/16 is via WAN1(BGP) and 10.100.0.0/16 is via WAN2 (static route)
Normally I would do this on RTR1, but due to other NAT setup on RTR1 it is not possible.
I peered RTR2 to RTR1 so it has the BGP peer list in the hope that I could match the traffic somehow to match an "ip nat inside" command.
My thought was do something like this:
ip nat inside route-map NAT2BGP interface interface FastEthernet0/1 overload
But I have not found a way in a route-map to match traffic from the BGP peer or even any BGP routes.
Does anyone have any suggestions?