NAT and port forwarding on Cisco
Internet access for the local network and port forwarding to servers.
Ready IOS commands with access by address, verification and rollback.
Internet access for the local network and port forwarding to servers.
Ready IOS commands with access by address, verification and rollback.
Internet access for the local network through one public address (PAT) and port forwarding to servers — ready IOS and IOS XE commands with an access list and a rollback.
Each rule opens a port on the outside address and sends it to a server on the local network. The outside port and the server port may differ.
The commands are built in your browser; addresses are not sent anywhere.
On a Cisco router NAT is built from three parts. Interfaces are marked as inside (ip nat inside) and outside (ip nat outside). A standard access list says which addresses may go out to the internet, and ip nat inside source list … overload replaces them with the outside address and different ports — that is PAT. Port forwarding is a static rule, ip nat inside source static tcp: packets to the outside port go to a server on the local network.
show ip interface brief.configure terminal mode, test from outside and only then save: copy running-config startup-config.The PASW-WAN-IN list is applied inbound on the outside interface. On IOS an inbound list is checked before NAT, so it contains the outside port and the outside address, not the server address. Each restricted rule gets a permit from the listed addresses and a deny for everyone else, and the list ends with permit ip any any so other traffic is untouched. If the interface already has a list of its own, move the lines into it. The ACL generator helps build a list from address ranges, and for MikroTik there is MikroTik port forwarding.
Without it IOS will not let you forward several ports of one outside address to the same inside address. The generator adds extendable when a server has more than one rule and the outside address is static. Rules with interface do not need it.
Classic NAT on IOS does not turn traffic back inside. From inside, reach the server by its inside address or add a record with the inside address to your internal DNS. Test forwarding from outside, for example over mobile internet.
No. On ASA and Firepower, NAT is set up with object network and nat (inside,outside). The generator is for IOS and IOS XE routers: ISR, the 800, 1900, 2900 and 4000 series, Catalyst 8000 and others.
show ip nat translations lists the current translations, show ip nat statistics shows the counters and the inside and outside interfaces, and show access-lists PASW-WAN-IN shows how many packets hit each line of the list. Dynamic translations can be cleared with clear ip nat translation *.