cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
418
Views
0
Helpful
1
Replies

load balancing using nat

sarahr202
Level 5
Level 5

hi every body.

I have been wrecking my small brain  to make it work.

Some Context:

If a interface is configured with " ip nat inside"  then order of operation is  first look up destionation ip, then perform nat,

If a interface is configured with " ip nat outside"  then order of operation is first nat then routing table look up.


Based on cisco web side that is what i learned

If i configure  :

ip nat inside destination list 1 pool zee

then any packet entering " inside nat interface "  whose destination matches the ip referenced in access list 1,will have  destination ip replaced by an ip from pool zee after  router performs the routing look up.

===============================================================

Armed with this new info, i tried to  came up with scenario to load balance the traffic.

here is my set up:

hosts--------------f0 (NAT) f1-----------------servers

Hosts  know the servers by ip 199.199.199.1

My goal is every time  router receives the packet destined for 199.199.199.1,  it will change the ip address to  200.200.200.1, 200.200.200.2 in round robin fashion,( two servers with ip address 200.200.200.1,200.200.200.2)

At my NAT router, i made these configurations

Int f0

ip nat inside

Int f1

ip nat outside

access-list 1 permit 199.199.199.1

ip nat pool zee 200.200.200.1 200.200.200.2 netmask 255.255.255.0 type rotary

ip nat inside destination list 1 pool zee

loopback1

199.199.199.1/24


Let say a host sends a packet to 199.199.199.1

here is my understanding

packets enters the " ip nat inside interface ".  router performs the routing table look up and finds the match (  as we configured the loopback 1)

next router performs NAT  and picks  200.200.200.1 from pool  and  replaces the destination ip by it.

Next router performs look up and forwards it to one of the server with ip address 200.200.200.1

But when i performed the lab,   and issue ping from host to 199.199.199.1, nat will not perform nat and simply sends the echo back to host(  I  used debug ip nat, debug ip packets on router  to verify but it will not translate)

any suggestion?

you guys have a great weekend.

1 Accepted Solution

Accepted Solutions

jgraafmans
Level 1
Level 1

You need to swap ip nat inside and ip nat outside on the interfaces so int f0 has ip nat outside and int f1 has ip nat inside configured.

View solution in original post

1 Reply 1

jgraafmans
Level 1
Level 1

You need to swap ip nat inside and ip nat outside on the interfaces so int f0 has ip nat outside and int f1 has ip nat inside configured.

Review Cisco Networking products for a $25 gift card