Cisco ip nat inside access list


I need to set a access list on a ip nat  voip rule.

i have this nat rules that works fine:

ip nat inside source static tcp 80 80 extendable
ip nat inside source static udp 5060 5060 extendable

Now i need to allow only a access list to pass over ip nat on port 5060 (voip), the port 80 its public só no access list required.

new rule to voip:

The access list:
access-list 100 permit udp eq 5060 any

the pool:
ip nat pool VOIP netmask type rotary
ip nat inside source list 100 pool VOIP

But this config don't work, all traffic was rejected, so what am doing wrong ?
Who is Participating?
_OpenSys_Connect With a Mentor Author Commented:
After lots of research and reading i found the way.

In public network interface:
ip access-group "name of access-list" in

the rule ip nat inside source list 100 interface FastEthernet4.3 overload only classify the output (private addresses) do will never works.

Thank you guys but i found my solution :)
Are you just trying to limit which public ip can come in on port 5060? Or are you trying to make a public appear like a private ip on your inside network?

If its the first case, define the nat rule without any acl's. configure an acl on the outside interface limiting the traffic on that port.

If its the second case, I think you might be using that nat command in the wrong direction. The way you have it, it means that any ip in the 79.41.34.x with source port 5060 can go anywhere from the INSIDE to the outside and get it's source nat'd to

The following show an outside nat
Marius GunnerudSenior Systems EngineerCommented:
as many PCs sen with a random source port the access list will never match unless traffic is sent on port 5060 (kind of what rauenpc said).  Also since your nat pool only has one address you would need to add the overload statement at the end of the NAT entry to allow more than 1 private IP to use the NATed IP at the same time.  try changing the access list and NAT statement:

access-list 100 permit udp any eq 5060

ip nat inside source list 100 pool VOIP overload
The IT Degree for Career Advancement

Earn your B.S. in Network Operations and Security and become a network and IT security expert. This WGU degree program curriculum was designed with tech-savvy, self-motivated students in mind – allowing you to use your technical expertise, to address real-world business problems.

_OpenSys_Author Commented:
No success my friends...

This is the perspective:

This portforward rule works for outside to inside, but is completed open for all internet:
ip nat inside source static udp 5060 5060 extendable

Now i need to limit it, and only can pass over this nat rule.
Please post some cisco IOS rules.
I would just add an ACL rule to the outside interface limiting traffic on port 5060 to the source subnet snmp-server

ip access-list extended OUTSIDE-IN
permit udp eq 5060 eq 5060
deny udp any eq 5060 eq 5060

The above would permit the subnet, and deny any other from attempting to come in via port 5060. You more than likely already have an outside acl, to the two lines would need to be added to the existing acl. Once in place, it won't matter that the NAT statement is wide open as the ACL still limits the traffic. You could then also enable logging on the deny rule if you'd like to see who gets denied.
do you have the interface on the outside (the one with the ip address configured with "ip nat outside" ?

I'm assuming it's a different router than the one you are using for the other NAT, or on a different interface.
Marius GunnerudSenior Systems EngineerCommented:
Remove the type rotary from the ip nat pool command.
_OpenSys_Author Commented:
No success until now, so i tried this simple method like this:

ip nat inside source list 100 interface FastEthernet4.3 overload
access-list 100 permit

All nat inside traffic must pass to access-list 100 right ?

So why when i put: "ip nat inside source static udp 5060 5060 extendable" and anyone can enter, making a bypass the access-list 100 . why?

I also try this rule above, but this port continues open for anyone and not only for acl 100:
ip nat inside source static udp 5060 interface FastEthernet4.3 5060

Ideas ?
_OpenSys_Author Commented:
The ip nat inside get's the public IP translated, so it fail. The solution is getting the IP on the head with ip access-group  on public interface.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.