- About VoIP
- What is VoIP and what it can do for you
- Introduction to VoIP (video)
- Why should you switch to VoIP services?
- Analog Telephony
- Digital Telephony
- What is SIP?
- How to start with VoIP telephony
- Web based VoIP
- How to choose a right VoIP provider?
- Wi-Fi network and VoIP
- VoIP Codecs
- Free sip account
- Confidential calls
- VPN: UDP or TCP?
- Mobile VoIP
- VoIP on your mobile
- Asterisk IP-PBX
- Who we are?
- How to start
- Free SIP account
- Configs
VoIP client behind a VPN with DD-WRT
By Nik On June 14, 2011 · In Asterisk, Mobile VoIP, QoS - Quality of Service, SIP protocol, VoIP over VPN
We have two sites with local networks interconnected by VPN tunnel and we have a VoIP server at one of the sites. The server side based on a PC with Windows 2003 Server (also acting as VoIP and VPN server) installed. On the other side we have a DD-WRT as the VPN client.
As we do not have static public IP’s, when the connection is “refreshed” (or get’s reconnected) the VoIP client not registering with VoIP server via VPN anymore.
We’ve search the Internet to find out the solution, and found many similar problems/situations, but very few were applicable to VoIP server be on the other side of the VPN tunnel (because they were always on the Internet).
And why the ATA (VoIP client) can not get registered when there is a connection dropped and restored? Well, there’s a routing table in the router tells you the origin of the data and what its destination. This table in the DD-WRT can be accessed if type root @ DD-WRT: ~ # grep 10.0.1.1 / proc / net / ip_conntrack in an SSH session (where 10.0.1.1 is the ip address you want to see the result for):
udp 17 src = 192.168.2.2 dst 3569 = 10.0.1.1 sport = 5062 dport = 5060 packets = 49 bytes = 23100 src = 10.0.1.1 dst = 192.168.2.2 sport = 5060 dport = 5062 packets = 33 bytes = 15090 [ASSURED] mark = 0 use = 8
udp 17 src = 192.168.2.2 dst 3590 = 10.0.1.1 sport = 5065 dport = 5060 packets = 121 bytes = 54934 [UNREPLIED] src = 10.0.1.1 dst = 192.168.1.2 sport = 5060 dport = 5065 packets = 0 bytes = 0 mark = 0 use = 2
In the lines above are a few things to consider: 3569 and 3590 is the time that this line is active on the router. So during this time there is no data traffic will be excluded from this line and a new table could be created if another connection is needed.
192.168.2.2 is the address of ATA is that the network client, behind the DD-WRT. The FXS port of the router’s FXO port 5065 and 5062.
192.168.1.2 is the WAN address of DD-WRT.
If we observe the rule that the DD-WRT set to port 5062 we will see that it is correct because the origin is the ATA (192.168.2.2) and target the VoIP server (10.0.1.1).
As for the port 5065 the rule is incorrect because the router is sent packets that should go to the VoIP server (10.0.1.1) to the Internet (WAN router – 192.168.1.2).
This error occurred because the router was restarted and the ATA was hooked. The ATA asked the very fast router “I need to register the VoIP server 10.0.1.1, do you know the route?” As the router DD-WRT had just “wake up” and had not yet started the VPN connection he replied “I don’t know, so he should be on the Internet, I’ll refer you over there”. And so the line is established. As I explained before, this line it will take 3590 / 2 to be deleted and even if the VPN connection is reestablished this rule will not be excluded. What reason for that? It’s a Keep-Alive.
The Keep-Alive is present in the ATA and the router is saying in the time interval programmed “Please do not delete the line that was created for my ports 5065 and 5062, because I need them.” In short, if Keep-Alive is set in 20 seconds, when the the time of 3590 and 3569 wounds in 3570 and 3549 respectively they will again return to orinal value and the line will never be deleted from the table.

How we can solve this?
The first and simplest is to use random ports on your ATA – each time a reconnection event appears it will use a different port (instead of 5062 and 5065 for example). This will solve the issue because it will create another row in the routing table.
The second way is to apply (in our example case we need a static port to be able to configure the IP-PBX) and add to a command in DD-WRT that cleans the table whenever the router is restarted and also whenever there is a reconnection of the VPN tunnel. See below:

The script is:
sleep 80
sh /proc/net/ip_conntrack_flush
#!/bin/sh
while [ 1 ]
do
if ! ping-c 1 10.0.1.1; then
/tmp/pptpd_client/vpn stop
/tmp/pptpd_client/vpn start
/proc/net/ip_conntrack_flush
fi
sleep 20
done
Explanation of script: First we are waiting for the router to bootup and start the services (80 seconds), then we clean the table with ip_conntrack_flush. If you do not use a VPN and the problem occurs with a VoIP server on the Internet you can stop here, the other lines are not necessary. The following commands verify that the VPN connection is active in a range of 20 continuous seconds and if not restart VPN client again and then again clean the table.
We hope it works for you as well! Original solution posted by Tobias Tromm, translated and posted by voip-sip.org with direct permission from Tobias.
Recent articles
- Plain explain: IP-phone
- Plain explain: What is SIP termination and what is SIP origination?
- US fixed VoIP market to see steady growth
- Save money with VoIP and unified communications
- IP telephony can help level the playing field for small businesses
- The loss of a landline means big change in communications
- Ubuntu (Linux) on your phone? Yes! And now officially!
- QoS For FaceTime, bandwidth requirements and Firewall config
- Merry Christmas and Happy New Year!
- How to Configure Axvoice Equipment?
- Cloud VoIP vs. on-premise VoIP: Choosing the right one for your business
- 26 terabits per second data transmission achieved
- A fully functional VoIP Client (SIP) finally released (free download)
- Fundamentals of SIP from Cisco :-)
- WebRTC from Google: making real-time communication free to implement
- What is VoIP termination
- Introduction to Voice over IP (VoIP)
- Linux: how to check OS version installed
- Hey!
- How to configure Internet tel. and SIP settings on Nokia phone (E52)
- TCP vs UDP – you must know this
- Google voice / Google talk and Asterisk configuration
- VoIP or IP Telephony?
- Asterisk 10.0.0-rc1 Now Available!
- SIP based VoIP behind NAT
- VoIP Quick start guide
- History: Kellogg Field Phone (World War I)
- Running VoIP via VPN (SSL) – voice quality
- Skype App directory
- G.711: u-law or a-law?
- Wi-Fi access point/router optimization for VoIP and other real time apps
- Agri-Cube grows mass quantities of vegetables in a one-car parking spot
- Quick Comparison of freeware IP-PBX platforms: Asterisk vs Open SER
- Microsoft enabling the ability to eavesdrop on VoIP conversations
- Nimbuzz growing even without Skype
- Skype protocol hack
- Call DSN number
- How to make your VoIP calls private and confidential
- Think on solutions: VoIP phone system
- Asterisk and Google Voice
- VoIP Codec: Payload size
- Nokia SIP settings
- The QoS Dilemma
- VoIP calls over satellite links
- VoIP for Facebook!
- VoIP client behind a VPN with DD-WRT
- Digital Telephony
- Analog Telephony
- Mobile VoIP – the future of mobile communications
- Sip on Android
VoIP SIP IP telephony tags
android Asterisk bandwidth bandwidth requirements best effort cellular codec delay encryption options facebook free calls g273 g726 g729 google gsm high latency How it works ilbc IPsec issues jitter listen to voip mobile Nimbuzz nokia order packet payload. g711 privacy protocol analyzer pstn QoS - Quality of Service QoS protocols real-time applications record voip calls satellite link sipdroid SIP protocol Skype speex TLS voice quality voip voip becomes socialQuick navigation
- Android (6)
- Apple (1)
- Asterisk (22)
- Cloud VoIP (1)
- FaceTime (1)
- Google Voice (6)
- History (2)
- IT news (2)
- Mobile VoIP (16)
- Symbian (1)
- Non VoIP news (2)
- Open source (10)
- Prioritization and traffic shaping (9)
- QoS – Quality of Service (11)
- SIP protocol (32)
- Cisco (2)
- SIP termination (2)
- SMS to email (1)
- Softphone VoIP (1)
- Ubuntu (1)
- Uncategorized (1)
- VoIP calls quality (24)
- VoIP industry news (4)
- VoIP over SSL VPN (1)
- VoIP over VPN (8)
- VoIP service (2)
- VoIP via VPN (1)
More to read on VoIP
- About
- About Mark Spencer
- Asterisk SIP Media NAT
- Browser-based VoIP: web page code to call over IP (to your VoIP account)
- Choosing the right provider
- Cisco ATA186 notes
- Free sip account
- Grandstream Budgetone configuration manual
- How to start with VoIP telephony
- Multiplexing RTP Data and Control Packets on a Single Port
- On-line payments
- VoIP Codecs
- VPN: UDP or TCP?
- What is VoIP and what it can do for you
- Why should you switch to VoIP services?
Blogroll
- Asterisk™: The Definitive Guide (new window) “Asterisk has been emblematic of the way that open source software has changed business—and changed the world”
- Blog Jon FreeSWITCH VOIP SIP Asterisk Linux Open Source
- Business.com Business.com is one of the Web’s largest directories for business products and services
- Ubuntu how-to www.ubuntuka.com Miscellaneous Ubuntu Tips, Tricks and Hints
Our Twitter – latest
- Introduction to Voice over IP (VoIP) - One important step into adopting VoIP is... voip-sip.org/introduction-t… 5 months ago
- How to configure Internet tel. and SIP... voip-sip.org/how-to-configu… 5 months ago
- Hey! - To all people who has an experience with Asterisk and Linux - quote of the day: "I have not failed.... voip-sip.org/hey/ 5 months ago
- What is VoIP termination - Many people keep asking me - what is VoIP Termination?... voip-sip.org/what-is-voip-t… 5 months ago
- How to configure Internet tel. and SIP... voip-sip.org/how-to-configu… 5 months ago




