NAT configuration in Cisco Packet Tracer with Source Code command
Command : Router 1: No Enable Configure terminal Interface FastEthernet 0/0 Ip address 10.0.0.1 255.0.0.0 No shutdown Exit Interface FastEthernet 1/0 Ip address 20.0.0.1 255.0.0.0 No shutdown Exit Router 2: No Enable Configure terminal Interface FastEthernet 0/0 Ip address 20.0.0.2 255.0.0.0 No shutdown Exit Interface FastEthernet 1/0 Ip address 30.0.0.1 255.0.0.0 No shutdown Exit For Router 1 Access-list 10 permit 10.0.0.0 0.255.255.255 Interface fa1/0 Ip nat inside Exit Interface fa0/0 Ip nat outside Exit Ip nat pool mypool 20.0.0.1 20.0.0.6 netmask 255.255.255.0 Ip nat inside source list 10 pool mypool Ip route 0.0.0.0 0.0.0.0 20.0.0.2 Exit Debug ip nat
Command : Router 1: No Enable Configure terminal Interface FastEthernet 0/0 Ip address 10.0.0.1 255.0.0.0 No shutdown Exit Interface FastEthernet 1/0 Ip address 20.0.0.1 255.0.0.0 No shutdown Exit Router 2: No Enable Configure terminal Interface FastEthernet 0/0 Ip address 20.0.0.2 255.0.0.0 No shutdown Exit Interface FastEthernet 1/0 Ip address 30.0.0.1 255.0.0.0 No shutdown Exit For Router 1 Access-list 10 permit 10.0.0.0 0.255.255.255 Interface fa1/0 Ip nat inside Exit Interface fa0/0 Ip nat outside Exit Ip nat pool mypool 20.0.0.1 20.0.0.6 netmask 255.255.255.0 Ip nat inside source list 10 pool mypool Ip route 0.0.0.0 0.0.0.0 20.0.0.2 Exit Debug ip nat