静态配置:


Router(config)#ip nat outside source static 10.10.10.1 171.16.68.5  

Router(config)#interface f0/0

Router(config-if)#ip nat inside

Router(config)#int f0/1

Router(config-if)#ip nat outside
Router(config-if)#end

Router#show ip nat translations
Pro  Inside global     Inside local       Outside local      Outside global
---  ---               ---                171.16.68.1        10.10.10.5

动态配置:

思科NAT静态和动态配置_NAT配置 

Router(config)#int e7/0
Router(config-if)#ip add 10.10.10.1 255.255.255.0
Router(config-if)#no shut


%LINK-5-CHANGED: Interface Ethernet7/0, changed state to up
Router(config-if)#ip nat inside
Router(config-if)#exi
Router(config)#int e6/0
Router(config-if)#ip add 10.10.20.1 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface Ethernet6/0, changed state to up
Router(config-if)#ip nat inside
Router(config-if)#exi
Router(config)#int serial 5/0
Router(config-if)#ip address 172.16.10.64 255.255.255.0
Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial5/0, changed state to down
Router(config-if)#ip nat outside
Router(config-if)#exi
Router(config)ip nat pool  ccie 172.16.10.1 172.16.10.63 prefix 24


                                    ^

Router(config)#ip nat inside source list 7 pool ccie

Router(config)#access-list 7 permit 10.10.10.0 0.0.0.31
Router(config)#access-list 7 permit 10.10.20.0 0.0.0.31
                                                         ^