cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
438
Views
0
Helpful
5
Replies

NAT of same IP to different IPs

cweissheimer
Level 1
Level 1

Hi, I need to convert the same IP to two different IPs depending on destination address of packet.

I've tested two "ip nat outside source ...", each one with a route-map that test the destination address, but in the first packet natted com dest address X,for example, a NAT's entry is created and after that, even the packet is sent to dest address Y, the entry created before is used not regarding the destination address. Some ideas ?

Thanks,

Cleber

5 Replies 5

gmarogi
Level 5
Level 5

If you are using different interfaces to reach the destinations, try to match on the next-hop IP address.

Hi, thanks.

I tried to use route-map to match destination IP in order to convert to right address, however when I use in inside side, the NAT table uses number ports, so I have problem when the packtes come from outside, in the other way around, using route-map in outside, the NAT table doesn't use ports number, so the route-map didn't work out, the first that is actived is used forever.

Thanks,

Cleber

preddyi
Level 3
Level 3

You can achive this by using NAT overloading with Extended access-list

Creat two NAT overload entries,each with differenet extended access-list.

Access-list should contain source and destination.

Both the access-list will have same source but diffrent destinations.

Ex:

Inside local ip pool 10.0.0.x/24,

Inside Global IP pool 172.16.0.x/24 ,

Outside global : 192.168.0.x/24 ,

source is 10.0.0.100/24

destination1: 192.168.0.1 (Loopback1)

destination2: 192.168.0.2 (Loopback2)

Inside interface Fa0/0 -- 10.0.0.1/24

Outside inteface Fa0/1 -- 10.0.1.1./24

I want the source ip address of the packet from 10.0.0.1 to 2 diffrent destinations, should get change as Loopback 1 and loopback 2 ip addresses, when the packet is leaving my NAT router.

Configuration looks like following.

-------------------------------------------

Access-list 101 permit 10.0.0.1 host 192.168.0.1

Access-list 102 permit 10.0.0.1 host 192.168.0.2

ip nat inside ip source list 101 inteface loopback1 overload

ip nat inside ip source list 102 inteface loopback2 overload

Interface Loopback 1

Ip address 172.16.0.1

Interface Loopback 2

Ip address 172.16.0.2

Inteface FastEthernet0/0

Ip address 10.0.0.1

Ip nat inside

inteface FastEthernet0/1

Ip address 10.0.1.1

ip nat outside

ip route 0.0.0.0 0.0.0.0 Fa0/1

-----------------------------------------------

Ok, but the problem is when the connection starts in outside, for example, from 192.168.0.1 and 192.168.0.2, these will not ne converted in 10.0.0.1.

Thanks,

Cleber

If your requirement is,

Host1 accessing from outside to HOST.X residing in inside should get translate to HOST.A

Host2 accessing from outside to the same HOST.X residing in inside should get translate to HOST.B

You can do this , by creating two NAT pools, both having only one IP (HOST.A or HOST.B)