我刚刚安装了 NEC PBX,它允许我使用 SIP 中继线提供 VoIP 服务,我的网关是运行 8.4 的 Cisco ASA 5505,并且我只有一个公共/静态 IP 地址。
到目前为止,我的中继已注册,我可以拨打电话,一切正常,但来电无声(双向)。我猜想这是因为 UDP 端口 1024-1215 未转发,SIP(5060)也未转发。
我需要做的是转发 1024-1215 的 UDP 端口范围,但似乎我无法为 UDP 创建端口映射,也无法在静态路由中为 UDP 定义端口范围。任何正确的帮助都将不胜感激 !!!(我被告知 ASA 8.4 将允许转发一系列端口,因此我进行了升级,但现在我对新命令有点迷茫)
使用 ASDM 我尝试了几次,结果如下:
[OK] object network NEC_DSX
object network NEC_DSX
[ERROR] nat (inside,outside) static interface service udp 1024-1215 1024-1215
nat (inside,outside) static interface service udp 1024-1215 1024-1215
^
ERROR: % Invalid input detected at '^' marker.
I also tried:
[OK] object network NEC_DSX
object network NEC_DSX
[ERROR] nat (inside,outside) static interface service udp 1024 1024
NAT unable to reserve ports.
------------------------
Here is my current config :
ASA Version 8.4(4)
!
hostname ciscoasa
enable password 8Ry2YjIyt7RRXU24 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
name 24.173.xxx.xxx StaticOutside description WAN IP
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.3.1 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address StaticOutside 255.255.255.252
!
boot system disk0:/asa844-k8.bin
boot system disk0:/asa832-k8.bin
ftp mode passive
object network obj-192.168.3.5
host 192.168.3.5
object network obj_any
subnet 0.0.0.0 0.0.0.0
object network NEC_DSX
host 192.168.3.150
description NEC DSX SYSTEM
access-list outside_access_in extended permit tcp any host 192.168.3.5 eq 3389 log disable
pager lines 24
logging asdm informational
mtu inside 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-649-103.bin
no asdm history enable
arp timeout 14400
!
object network obj-192.168.3.5
nat (inside,outside) static interface service tcp 3389 3389
object network obj_any
nat (inside,outside) dynamic interface
access-group outside_access_in in interface outside
route outside 0.0.0.0 0.0.0.0 24.173.100.85 1
timeout xlate 3:00:00
timeout pat-xlate 0:00:30
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
http server enable
http 192.168.3.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
telnet timeout 5
ssh timeout 5
ssh key-exchange group dh-group1-sha1
console timeout 0
dhcpd auto_config outside
!
dhcpd address 192.168.3.10-192.168.3.38 inside
dhcpd dns 4.2.2.1 4.2.2.2 interface inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics host
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
inspect ip-options
class class-default
user-statistics accounting
!
service-policy global_policy global
prompt hostname context
no call-home reporting anonymous
Cryptochecksum:85d3bff9e7eb561bf8ee4f27b11a6cf4
: end
答案1
您无需明确转发 RTP 端口 (>1024),因为您已sip inspect
打开。当 SIPINVITE
传来时,路由器将在通话期间打开相应的 RTP 端口。
就 NATing SIP 而言,您缺少 NAT 命令和访问列表条目:
! this should be tightened to allow traffic only from your telephone company, or
! people with bad intent will happily place international calls on your account
access-list outside_access_in extended permit udp any host 192.168.3.150 eq 5060
! nat 5060 to 5060
object network NEC_DSX
nat (inside,outside) static interface service udp 5060 5060
虽然不需要,转发范围的正确语法是:
object service rtp-1024-1215
service udp source range 1024 1215
object network NEC_DSX_RTP
host 192.168.3.150
nat (inside,outside) static interface service rtp-1024-1215 rtp-1024-1215