This page provides step-by-step instructions for configuring Network Address Translation (NAT) on a router or network device using the command-line interface.
- NAT Configuration
To enable NAT, follow these steps:
enable
configure terminal
Create a NAT pool with a specific name using the following command:
nat pool-name <nat-pool-name>
Configure the outside NAT interface. You have two options:
interface <outside-nat-interface-name>
ip dhcp-client
ip nat outside pool-name <nat-pool-name>
end
interface <outside-nat-interface-name>
ip address <ipv4-address> <ipv4-subnet>
ip nat outside pool-name <nat-pool-name>
end
Configure the inside NAT interface with the following commands:
interface <inside-nat-interface-name>
ip address <ipv4-address> <ipv4-subnet>
ip nat inside pool-name <nat-pool-name>
ip dhcp-server pool-name <dhcp-server-pool-name>
end
Create an access control list (ACL) with ID 999 to permit specific source addresses:
access-list 999 permit $SOURCE_ADDRESS $SUBNET_MASK
Define the NAT pool's IP range and netmask:
ip nat pool <nat-pool-name> <inside-nat-ip-range-ip-start> <inside-nat-ip-range-ip-end> netmask <inside-nat-ip-netmask>
Associate the NAT pool with an access control list (ACL) for either inside or outside sources:
ip nat pool <nat-pool-name> [inside|outside] source list <acl-id>
; When negating, user MUST remove pool from interfaces first
[no] ip nat pool <nat-pool-name>
interface <inside-nat-interface-name>
#; Optional ip address when selecting the nat outside pool
ip address <ipv4-address> <ipv4-subnet>
[no] ip nat [inside | outside] pool <nat-pool-name>
#; Optional dhcp-server pool when selecting nat inside pool
ip dhcp-server pool <dhcp-server-pool-name>
end
access-list 999 permit $SOURCE_ADDRESS $SUBNET_MASK
This user manual provides a detailed guide for configuring NAT on your router or network device. Follow the steps outlined above to enable NAT and set up NAT pools, interfaces, access control lists, and more to control network traffic and IP address translation.
For any additional assistance or troubleshooting, please refer to the documentation for your specific router or device or contact your network administrator.