We help IT Professionals succeed at work.
Get Started

Port-forwarding of ports TCP/UDP 5060 on Juniper NetScreen 5GT to use Asterisk from outside

Last Modified: 2012-07-23

I am trying to setup port-forwarding on NetScreen 5GT so that I can register softphone over the Internet to Asterisk PBX which is running inside company office LAN.
Asterisk has IP address of

Up to now, I cannot connect to Asterisk from outside network.

I configured three things below:
1. Added Custom services for UDP 5060 (I have tried several patterns of TCP 5060 only, both TCP&UDP 5060, and TCP/UDP5060 + UDP 10000-20000)

2. I added VIP on 'Untrust' interface using Custom services called "AsteriskUDP".

3. Also added policy to allow traffic from 'Untrust' to 'Trust' for the above service.

The relevant portion is copied and pasted in the following:
set service "AsteriskUDP" protocol udp src-port 0-65535 dst-port 5060-5060
set alg sip app-screen unknown-message route permit
set alg sip app-screen unknown-message nat permit
set alg sip app-screen protect deny dst-ip
set vip multi-port
set zone "Trust" vrouter "trust-vr"
set zone "Untrust" vrouter "trust-vr"
set interface untrust vip untrust 5060 "AsteriskUDP"
set policy id 16 from "Untrust" to "Trust"  "Any" "VIP(untrust)" "AsteriskUDP" nat dst ip permit log
set policy id 16

With this configuration, I was trying to connect Softphone to Asterisk, but the network does not seem to go through. I used portal site of 'www.cman.jp' to check if the port-forwarding is active or not. But UDP cannot be confirmed with this service. Even TCP 5060 does not go through when I put TCP 5060 port-forwarding setup on 5GT separately.

On Asterisk, I enabled "TCPENABLE" statement to allow for registration using TCP packets.
But the situation does not change.

Please let me know if some configuration is missing or other things must be done.

Thanks in advance.
Watch Question
Systems Admin
This problem has been solved!
Unlock 1 Answer and 21 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE