I have a 2801 router with 3 interfaces: A, B and C.
There are two subnets behind interface B: suppose we name them subnet B0 and B1.
I need to do policy NAT from int A to B (only for traffic going to B0). And I need to do policy NAT from int B to C (only for traffic coming from B1).
Is this possible to do on a single router ? and what is the approximate way to do it ?
I think that you can do it with something like this, but how do you have 2 subnets behind 1 interface (B):
ip nat pool
ip nat inside source route-map b0 pool
access-list 1 permit
route-map b0 permit 10
match ip address 1
HTH, please rate if it does,
Thanks for your reply, Mohammed.
I believe this configuration takes care only of the traffic flowing from B0. I need traffic to B1 to be translated on interface B at the same time.
You can use the same thing with the traffic of B1, according to the match of the route-map the traffic will be NATed:
ip nat pool
ip nat inside source route-map b1 pool
access-list 2 permit
route-map b1 permit 10
match ip address 2
Now i got you, change this statement:
ip nat outside source route-map b0 pool
instead of: ip nat inside source route-map b0 pool
and do "ip nat inside" for interface B, and "ip nat outside" for interface A and C.
Mohammed, thanks for your reply.
I cannot use IP pools, I need port overloading (NAPT) on each interface. When using "ip nat outside" it only allows you to use an ip pool.
Please see the drawing below. Each line represents the traffic flow, and the arrow represents the interface where each flow should be NATed.
Let me know if you have other ideas.
As requested, I attach a sketch outlining the layout. As you see, the problem lies on interface B, where I need to do "NAT inside" for B1 subnet, and "NAT outside" for traffic to B0 hosts.