Asterisk behind NAT and Callers Behind a NAT


#1

Asterisk Users,

Good day guys before anything else i’d like to say Merry Christmas to all of you out there =), well here’s my setup

          netmax router/firewall   = eth1 public x.x.x.x
                   |                         = eth0 private/class c = 192.168.0.1
                   |
                  \/
    ----------------------
    | Manage SW        |------ snom 320 = DHCP
    |                          |------ snom 320 = DHCP
    ----------------------         
         |                    |          
    * server/dhcp            EyeBeam = DHCP        

192.168.0.2

on the firewall statefull inspection is in effect

iptables -t nat -A PREROUTING -d x.x.x.x -p udp --dport 5060 -j DNAT
–to 192.168.0.2:5060

iptables -t nat -A PREROUTING -d x.x.x.x -p udp --dport 10000:20000 -j
DNAT --to 192.168.0.2:10000-20000

FORWARD CHAIN

iptables -P FORWARD DROP
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT

OUTPUT CHAIN

everything is allowed

NAT table

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to x.x.x.x

IP FORWARDING IS on

echo 1 > /proc/sys/net/ipv4/ip_forward

sip.conf

[general]

externalip=x.x.x.x
localnet=192.168.0.0/255.255.255.0

disallo=all
allow=ulaw
allow=gsm
allow=ilbc
insecure=very

[2200]

type=friend
username=2200
password=secret
host=dynamic
canreinvite=no

[2201]

type=friend
username=2201
password=secret
host=dynamic
canreinvite=no

here’s the problem

INCOMING DID from voip provider doesn’t work using E1 interface card from digium no traffic at all as far as i can say on the firewall

INCOMING call from PSTN thru TDM400 cards works on IVR thing
but can’t make or establish a call to FWD or any other provider

Can you site a possible solution for this guys ?

i can’t put the * box on public ip for this due to security/political reason

Best regards,

Ronald


#2

Just to clarify… calls from the PSTN to the TDM400P work fine? But calls to/from remote networks via SIP do not yet they do work on the local LAN? If so then you need to troubleshoot what is going on at the network level. Try using sip debug and/or ethereal to see what is going wrong.


#3

yes traffic from pstn -> TDM400 is ok, but from remote network via SIP from voip provider doesn’t work, anyway thanks for your reply i just use plain OpenBSD router and rdr port 5060 and rtp 10000:20000 should be fine now.