Introduction
Network Address Translation (NAT) is a fundamental technique used in networking to translate private IP addresses to public IP addresses and vice versa. Static NAT is a method where a specific private IP address is mapped to a specific public IP address.
Configuration Steps
Router Configuration
Enable NAT Service
Router(config)#ip nat inside source static [inside-local] [inside-global]
- Replace
[inside-local]
with the private IP address to be translated. - Replace
[inside-global]
with the public IP address to translate to.
- Replace
Configure Interfaces
Router(config)# interface [inside-interface] Router(config-if)# ip address [inside-ip-address] [subnet-mask] Router(config-if)# ip nat inside Router(config-if)# no shutdown Router(config-if)# exit Router(config)# interface [outside-interface] Router(config-if)# ip address [outside-ip-address] [subnet-mask] Router(config-if)# ip nat outside Router(config-if)# no shutdown Router(config-if)# exit
- Replace
[inside-interface]
with the interface connected to the internal network. - Replace
[inside-ip-address]
and[subnet-mask]
with the appropriate IP address and subnet mask for the internal interface. - Replace
[outside-interface]
with the interface connected to the external network. - Replace
[outside-ip-address]
and[subnet-mask]
with the appropriate IP address and subnet mask for the external interface.
- Replace
Configure Static Routes
Router(config)# ip route [external-network] [subnet-mask] [next-hop-ip]
- Replace
[external-network]
with the destination network. - Replace
[subnet-mask]
with the subnet mask of the destination network. - Replace
[next-hop-ip]
with the next-hop IP address to reach the external network.
- Replace
Save Configuration
Router# write memory
Verification and Testing
Check NAT Translations
Router# show ip nat translations
Check NAT Statistics
Router# show ip nat statistics
Perform Ping Tests
SourceDevice> ping [destination-public-ip]
Check Routing Table
Router# show ip route
Comments
Post a Comment