cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
701
Views
0
Helpful
10
Replies

Mixed NAT

apaladi
Level 1
Level 1

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 ?

Thanks.

10 Replies 10

spremkumar
Level 9
Level 9

Hi

Small piece of a network/topology diagram will help here to understand the network/requirement..

regds

Please see below, let me know if it's still not clear. Thanks.

mohammedmahmoud
Level 11
Level 11

Hi there,

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 x.x.x.x x.x.x.x prefix-length y

ip nat inside source route-map b0 pool overload

access-list 1 permit

route-map b0 permit 10

match ip address 1

match interface

HTH, please rate if it does,

Mohammed Mahmoud.

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.

Hi there,

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 w.w.w.w w.w.w.w prefix-length y

ip nat inside source route-map b1 pool overload

access-list 2 permit

route-map b1 permit 10

match ip address 2

match interface

HTH,

Mohammed Mahmoud.

This is also clear, but how do I configure NAT on the interface B itself: "ip nat inside" or "ip nat outside" or "ip nat enable" ?

Hi there,

Now i got you, change this statement:

ip nat outside source route-map b0 pool overload

instead of: ip nat inside source route-map b0 pool overload

and do "ip nat inside" for interface B, and "ip nat outside" for interface A and C.

HTH,

Mohammed Mahmoud.

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.

Thanks again.

apaladi
Level 1
Level 1

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.

apaladi
Level 1
Level 1

Network/traffic layout

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card