ip vrf ISPA rd 100:0 route-target export 100:0 route-target import 100:1
ip vrf ISPB rd 100:1 route-target export 100:1 route-target import 100:0
ip vrf LAN rd 100:100 route-target import 100:0 route-target import 100:1
ip vrf forwarding ISPA
ip nat outside
interface FastEthernet0/0 ip vrf forwarding ISPA ip address 50.0.0.1 255.0.0.0 ip nat outside
ip vrf forwarding ISPB
ip nat outside
interface FastEthernet1/0 ip vrf forwarding ISPB ip address 60.0.0.1 255.0.0.0 ip nat outside
ip vrf forwarding LAN
ip nat inside
interface FastEthernet1/1 ip vrf forwarding LAN ip address 192.168.0.1 255.255.255.0 ip nat inside
ip route vrf ISPA 0.0.0.0 0.0.0.0 50.0.0.2 ip route vrf ISPB 0.0.0.0 0.0.0.0 60.0.0.2
redistribute connected
redistribute static default-information originate
maximum-paths 2
router bgp 65000 address-family ipv4 vrf ISPA redistribute connected redistribute static default-information originate address-family ipv4 vrf ISPB redistribute connected redistribute static default-information originate address-family ipv4 vrf LAN redistribute connected maximum-paths 2
ip nat inside source route-map A interface FastEthernet0/0 vrf LAN overload ip nat inside source route-map B interface FastEthernet1/0 vrf LAN overload
route-map A permit 10 match ip address 1 match interface FastEthernet0/0 route-map B permit 10 match ip address 1 match interface FastEthernet1/0 access-list 1 permit 192.168.0.0 0.0.0.255
R1#traceroute vrf LAN 8.8.8.8 source fa 1/1 Type escape sequence to abort. Tracing the route to 8.8.8.8 VRF info: (vrf in name/id, vrf out name/id) 1 50.0.0.2 132 msec 60.0.0.2 44 msec 50.0.0.2 24 msec
R1#show ip nat translations Pro Inside global Inside local Outside local Outside global udp 50.0.0.1:49162 192.168.0.1:49162 8.8.8.8:33434 8.8.8.8:33434 udp 60.0.0.1:49163 192.168.0.1:49163 8.8.8.8:33435 8.8.8.8:33435 udp 50.0.0.1:49164 192.168.0.1:49164 8.8.8.8:33436 8.8.8.8:33436
R1#show ip route vrf LAN B* 0.0.0.0/0 [20/0] via 60.0.0.2 (ISPB), 00:00:20 [20/0] via 50.0.0.2 (ISPA), 00:00:20 50.0.0.0/8 is variably subnetted, 2 subnets, 2 masks B 50.0.0.0/8 is directly connected (ISPA), 00:00:22, FastEthernet0/0 L 50.0.0.1/32 is directly connected, FastEthernet0/0 60.0.0.0/8 is variably subnetted, 2 subnets, 2 masks B 60.0.0.0/8 is directly connected (ISPB), 00:00:20, FastEthernet1/0 L 60.0.0.1/32 is directly connected, FastEthernet1/0 192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.0.0/24 is directly connected, FastEthernet1/1 L 192.168.0.1/32 is directly connected, FastEthernet1/1
# interface FastEthernet0/0 ip address 50.0.0.1 255.0.0.0 ip nat outside # interface FastEthernet1/0 ip address 60.0.0.1 255.0.0.0 ip nat outside # interface FastEthernet1/1 ip address 192.168.0.1 255.255.255.0 ip nat inside #PBR ip local policy route-map PBR #NAT ip nat inside source route-map A interface FastEthernet0/0 overload ip nat inside source route-map B interface FastEthernet1/0 overload ip route 0.0.0.0 0.0.0.0 50.0.0.2 ip route 0.0.0.0 0.0.0.0 60.0.0.2 #PBR route-map PBR permit 10 match ip address 10 set ip next-hop 50.0.0.2 #PBR route-map PBR permit 20 match ip address 11 set ip next-hop 60.0.0.2 # NAT route-map A permit 10 match ip address 1 match interface FastEthernet0/0 # NAT route-map B permit 10 match ip address 1 match interface FastEthernet1/0 # acl access-list 1 permit 192.168.0.0 0.0.0.255 access-list 10 permit 50.0.0.1 access-list 11 permit 60.0.0.1
ip cef
Source: https://habr.com/ru/post/273813/