当前位置:网站首页>port forwarding
port forwarding
2022-08-10 21:35:00 【51CTO】
Port Forwarding is configured on the router (machine making nat) and will forward connections originated from external clients to internal machine running asterisk.
If using Linux/Netfilter, run, on router:
# SET SIP SERVER INTERNAL IP (LAN)
SIP_SRV_LAN_IP=192.168.0.123
# FORWARDING
iptables -t nat -A PREROUTING -p udp -m multiport --dport 5060,10000:20000 -j DNAT --to-destination $SIP_SRV_LAN_IP
# ALLOW ASTERISK CONNECTIONS/REPLIES TO OUTSIDE (INTERNET)
iptables -A FORWARD -p udp -s $SIP_SRV_LAN_IP -j ACCEPT
# ALLOW FORWARDED CONNECTIONS/REPLIES TO INSIDE (LAN)
iptables -A FORWARD -p udp -m multiport --dport 5060,10000:20000 -d $SIP_SRV_LAN_IP -j ACCEPT
The range 10000:20000 is not mandatory, but in asterisk it is the default configuration. It can be checked (and altered if necessary) in the file rtp.conf, found generally in /etc/asterisk/rtp.conf.
边栏推荐
猜你喜欢

Huawei router clock near the drainage experiment (using stream strategy)

JVM经典五十问,这下面试稳了

为什么一般公司面试结束后会说「回去等消息」,而不是直接告诉面试者结果?

【PCBA scheme design】Bluetooth skipping scheme

新一代网络安全防护体系的五个关键特征

从斐波那契 - 谈及动态规划 - 优化

shell脚本循环语句for、while语句

Shell编程规范与变量

ThreadLocal comprehensive analysis (1)

Service - DNS forward and reverse domain name resolution service
随机推荐
Shell programming specification and variables
【SQL刷题】Day3----SQL必会的常用函数专项练习
web逆向之丁香园
如何保护 LDAP 目录服务中的用户安全?
UPDATE:修改数据语法使用例——《mysql 从入门到内卷再到入土》
HighTec快捷键(Keys)设置位置
VLAN huawei 三种模式
Common interview questions for APP UI automation testing, maybe useful~
【PCBA方案设计】蓝牙跳绳方案
About DataFrame: Processing Time
ENVI感兴趣区ROI文件由XML格式转为ROI格式
LeetCode-36-Binary search tree and doubly linked list
Labelme-5.0.1 version edit polygon crash
黑猫带你学Makefile第12篇:常见Makefile问题汇总
shell脚本
函数:函数删除操作语法&使用例——《mysql 从入门到内卷再到入土》
直播课堂系统09--腾讯云点播管理模块(一)
ThreadLocal全面解析(一)
ArcMap创建镶嵌数据集、导入栅格图像并修改像元数值显示范围
[SQL brush questions] Day3----Special exercises for common functions that SQL must know