I thought I’d go over these two concepts really quickly.
NAT Pools – When you are overloading a single IP, the truth is that you are using the ports available on that IP to send and recieve traffic and that’s translating to IP’s on the inside.
Once you have even a few pc’s you can see from the translation table that many many ports are used, and while these connections tend to get torn down quickly, it’s still quite possible to run out. It really just depends on how many active clients you have to nat.
To overcome this, you can create a pool of external IP’s to overload. The router will simply move to the next IP when the first has too many ports full.
Lets use the same lab as our last NAT example.
Router0 is using 18.104.22.168 as it’s interface. It’s gateway is 22.214.171.124, which is on Router1.
If we are using that same lab.. we need to remove the nat command we issued earlier.
WORKRTR(config)#no ip nat inside source list INSIDE_NAT_ADDRESSES interface GigabitEthernet0/1 overload
if you have active connections you will be asked to kill those connections, and nat will of course.. stop.
to nat overload, first we need to create a nat pool. In this example, I want to make ip’s 126.96.36.199 thru 188.8.131.52 available in my pool.
WORKRTR(config)#ip nat pool OUTSIDE_PUBLIC 184.108.40.206 220.127.116.11 netmask 255.255.255.0
and now we simply create our nat using the same ACL we made in our last example.
WORKRTR(config)#ip nat inside source list INSIDE_NAT_ADDRESSES pool OUTSIDE_PUBLIC overload
We can now see in in the translations tables the nats being created.
WORKRTR#sho ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 18.104.22.168:102410.0.0.101:7 22.214.171.124:7 126.96.36.199:1024
icmp 188.8.131.52:102510.0.0.101:8 184.108.40.206:8 220.127.116.11:1025
icmp 18.104.22.168:102610.0.0.101:9 22.214.171.124:9 126.96.36.199:1026
icmp 188.8.131.52:102710.0.0.101:10 184.108.40.206:10 220.127.116.11:1027
icmp 18.104.22.168:102810.0.0.101:11 22.214.171.124:11 126.96.36.199:1028
icmp 188.8.131.52:102910.0.0.101:12 184.108.40.206:12 220.127.116.11:1029
icmp 18.104.22.168:103010.0.0.101:13 22.214.171.124:13 126.96.36.199:1030
icmp 188.8.131.52:103184.108.40.206:14 220.127.116.11:14 18.104.22.168:1031
icmp 22.214.171.124:103126.96.36.199:15 188.8.131.52:15 184.108.40.206:1032
icmp 220.127.116.11:103310.0.0.101:16 18.104.22.168:16 22.214.171.124:1033
icmp 126.96.36.199:103410.0.0.101:17 188.8.131.52:17 184.108.40.206:1034
icmp 220.127.116.11:103510.0.0.101:18 18.104.22.168:18 22.214.171.124:1035
icmp 126.96.36.199:103610.0.0.101:19 188.8.131.52:19 184.108.40.206:1036
icmp 220.127.116.11:103710.0.0.101:20 18.104.22.168:20 22.214.171.124:1037
icmp 126.96.36.199:103810.0.0.101:21 188.8.131.52:21 184.108.40.206:1038
icmp 220.127.116.11:103910.0.0.101:22 18.104.22.168:22 22.214.171.124:1039
icmp 126.96.36.199:104010.0.0.101:23 188.8.131.52:23 184.108.40.206:1040
icmp 220.127.116.11:10418.104.22.168:24 22.214.171.124:24 126.96.36.199:1041
icmp 188.8.131.52:104184.108.40.206:25 220.127.116.11:25 18.104.22.168:1042
icmp 22.214.171.124:104310.0.0.101:26 126.96.36.199:26 188.8.131.52:1043
I can’t really create the traffic in my lab to make this jump to the next IP however 😀
This is also really useful to you, if you have an IP that it’s internal and you want to map that IP completley 1 to 1 to another ip on the other side of the router (publicly, for example) you may follow the next example to accomplish this.
In our diagram you see on the Inside a Server which is IP 10.0.0.254 and we want to make this server publicly available as 184.108.40.206. On our router we as seen before specify on the interface which is inside and which is outside. And then we pass the following command:
WORKRTR(config)#ip nat inside source static 10.0.0.254 220.127.116.11
Now on our other server on the outside we can test access via ping.
Pinging 18.104.22.168 with 32 bytes of data:
Reply from 22.214.171.124: bytes=32 time=1ms TTL=126
Reply from 126.96.36.199: bytes=32 time=0ms TTL=126
Reply from 188.8.131.52: bytes=32 time=11ms TTL=126
Reply from 184.108.40.206: bytes=32 time=12ms TTL=126
Ping statistics for 220.127.116.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 12ms, Average = 6ms
Also if you wanted to only do certain ports, for example, just port 80, you can do so in this way:
WORKRTR(config)#ip nat inside source static tcp 10.0.0.254 80 18.104.22.168 80
Or perhaps I wanted to send traffic that would normally go to port 3389 to some wild port so that it would mitigate an attack directed towards rdp:
WORKRTR(config)#ip nat inside source static tcp 10.0.0.254 3389 22.214.171.124 12658