如果用commercial router, 有獨立public IP 的話，基本上唔需要改SIP and RTP ports作者: 角色 時間: 2011-10-1 11:27
角色作者: ckleea 時間: 2011-10-1 12:56
本帖最後由 ckleea 於 2011-10-1 13:37 編輯
Let me check my router and get back. There is a way to do direct Public ip binding to internal ip. Now I am working in different way.作者: ckleea 時間: 2011-10-1 13:37
Here is my router WAN mode
The WAN mode page allows you to configure how your router should use your external Internet connections, for example your WAN1 and WAN2 port connections.
NAT is a technique which allows several computers on a LAN to share an Internet connection. The computers on the LAN use a "private" IP address range while the WAN port on the router is configured with a single "public" IP address.
Along with connection sharing, NAT also hides internal IP addresses from the computers on the Internet.
NAT (Network Address Translation)
Select NAT if your ISP has assigned only one IP address to you. The computers that connect through the router will need to be assigned IP addresses from a private subnet (example: 192.168.1.0). If your ISP has assigned an IP address for each of the computers that you use, select Classic Routing.
Note: The router will delete all inbound firewall rules when switching between NAT and Classic Routing.
Load Balancing Settings
These options allow you to configure the router to balance internet traffic across all of the configured WAN ports, or to use a redundant ISP link for backup purposes.
Select Load Balancing mode to distribute your internet load among configured ISP's simultaneously. The active WAN interfaces (at least 2) will carry data for the protocols that are bound to them. Protocol bindings can be specified in the Protocol Bindings menu. For example, if the HTTP protocol is bound to WAN1 and FTP protocol is bound to WAN3, then the router will automatically channel FTP data from and to the computers on the LAN through the WAN3 port. All HTTP traffic will be routed through the WAN1 port. This feature can be used to segregate traffic between links that are not of the same speed. High volume traffic can be routed through a port connected to a high speed link and low volume traffic can be routed through a different port connected to the slow link. When the router is configured in Load Balancing Mode, it checks the connection of both the links at regular intervals to detect its status. If WAN is configured for Idle Timeout, then Load Balancing Mode is not applicable.
This device supports Weighted Load Balancing (LB), where balance weights are calculated based on WAN link speed and available WAN bandwidth. This is the default and most efficient balancing algorithm. With Round-robin load balancing, new traffic connections are sent over a WAN link in a serial method irrespective of bandwidth or link speed. For example if WAN1, WAN2, and WAN3 are active in round-robin load balancing, a HTTP request will first be sent over WAN1, and then a new FTP session will start on WAN2, and then any new connection to the internet will be made on WAN3. This method ensure that any one WAN will not have a disproportionate distribution of sessions over that single link.
Primary WAN mode should be used when load balancing is not required, and all internet traffic should be sent over the selected primary WAN (choose between WAN1 to WAN4). Enable Auto Rollover to use a single WAN for all internet connectivity until a failure on that link is detected. Once a failure on the primary WAN link is detected, all active connections to the internet will be rolled over to the selected secondary WAN port.
Note: If Auto Rollover mode is selected, you must configure the primary WAN port's Failure Detection Method, located in the WAN Advanced Options page.
Note: IPsec VPN policies will be rolled over in both Load balancing and failover mode.作者: 角色 時間: 2011-10-1 13:42
Could you please simplify the discussion and let us have a look at your configuration?
YH作者: ckleea 時間: 2011-10-1 13:48
If you have a commercial router or one that allows direct binding of public IP to internal asterisk server, then you do not need port forward. All default SIP, IAX, RTP ports can be used for the asterisk.
However, if you can use only NAT mode, then multiple asterisk servers can only be accessible by having different SIP, IAX, RTP ports for each server. Adjustment of the settings are required to ensure the servers are accessible and functional.作者: 角色 時間: 2011-10-1 21:23
Last time I had problem in connecting with my Intel ATOM-based Asterisk server. I do not know whether the problem came from the setting for type, which I mistyped as typp. I will check it on Monday morning to see any improvement if I changed it to type.
Anyway, whatever configurations are appreciated.
YH作者: alang 時間: 2011-10-3 12:01
是我搞混了，有多個 public IP 就不需要分開 port。作者: ckleea 時間: 2011-10-3 12:48
Not your fault. Sometimes, we also mix up the wan mode and number of IPs we have.
BTW, did you implement cdr-stats in your system? I saw the information in your website作者: 角色 時間: 2011-10-5 00:14
Now I have two servers running at the same time，one is QNAP TS-119 NAS Asterisk and the other is Intel ATOM-based D515 Asterisk. I may add another one IP-01 later. If I have time, I may add one more for testing purpose.
YH作者: ckleea 時間: 2011-10-5 07:21
I recall I do not need to make this port change when I have two asterisk servers. But I use two public IP.作者: 角色 時間: 2011-10-5 07:23
If you do have two public IP addresses, you do not need this port forwarding process.
YH作者: 角色 時間: 2011-10-5 07:38
问题： Asterisk Server B可以注册到，但是内外互打出问题，两边什么声音都听不到。
1) 我Asterisk Server A的rtp.conf已经更改为10000-10999, 而Server A，已经更改过。而Server B, router都做了port forwarding，如UDP 5228， 11000-11999，分流到Server B IP address。
2） 查找后，发现在router对应Server A的RTP port forwarding 10000-20000, 没有更新，现在更改为10000-10999 (因为没有时间测试，所以不知道这次更改后，是否通话正常？）
角色作者: ckleea 時間: 2011-10-5 08:19
It should work for you作者: 角色 時間: 2011-10-7 07:21
It is confirmed that with the revised settings, both SIP signalling and RTP voice packets work perfectly.
YH作者: ttmuskie 時間: 2011-10-20 12:53
Registered but no sound, my NAT problem?
1. Router set port Forward 7000-7999 (both TCP and UCP)
Is there anything I need to set? Thanks!作者: 角色 時間: 2011-10-20 13:09
Are you testing the Asterisk within the network segment?
What is the model number of QNAP that you using?
YH作者: ttmuskie 時間: 2011-10-20 13:57
1. I'm testing it from outside and connect back to my home network
2. I don't have any QNAP and my asterisk is run under ubuntu.
I just figured out my Android SIP client (CSIPSimple) need to enable the stun server in order to hear the sound. Any recommendation for the stun server? Thanks.作者: bubblestar 時間: 2011-10-20 14:41
It depends. It is not necessary for me to enable stun in Asterisk and other voip devices behind NAT. If you need to , you may try this one stun.xten.com