Translating Some Addresses Statically and Others Dynamically
Problem
You want certain hosts to have static address translation properties and all others to use dynamic translation.
Solution
In some cases you might need to use a combination of the two approaches. Some internal devices will always translate to specific external addresses, but others will use a dynamic pool. This is often the case when you have a few internal servers that need to be accessed from outside of the network, but other devices that will only make outbound connections:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#access-list
15
deny
Router(config)#
192.168.1.15 0.0.0.0
access-list
15
deny
Router(config)#
192.168.1.16 0.0.0.0
access-list
15
permit
Router(config)#
192.168.0.0 0.0.255.255
ip nat inside source static
Router(config)#
192.168.1.15 172.16.1.10
ip nat inside source static
Router(config)#
192.168.1.16 172.16.1.11
ip nat pool
NATPOOL 172.16.1.100 172.16.1.150
netmask
Router(config)#
255.255.255.0
ip nat inside source list
15
pool
NATPOOL
overload
Router(config)#interface
Router(config-if)#
FastEthernet0/0
ip address
Router(config-if)#
192.168.1.1 255.255.255.0
ip nat inside
Router(config-if)#exit
Router(config)#interface
Router(config-if)#
FastEthernet0/1
ip address
Router(config-if)#
192.168.2.1 255.255.255.0
ip nat inside
Router(config-if)#exit
Router(config)#interface
Router(config-if)#
Ethernet0/0
ip address
Router(config-if)#
172.16.1.2 255.255.255.0
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.