Thanks to some sterling advice from Daniel I have smeserver-openvpn-routed installed on SME v9 in server gateway mode. The server runs on a VM.
It currently runs ipsec and asterisk quite happily via the 'dummy' internal network interface 192.168.98.0
I have been trying to see if I can get my mobiles to connect and use Asterisk as well. I can get a connection, browse the net etc (that I don't really need) but I get the one way audio hell with Asterisk
I believe this is probably due to some pixie dust missing somewhere

Using the standard OpenVPN client on the phone I notice that if I accept a standard configuration, I get one way audio and can see this with tcpdump.
Typical opvn config :
client
proto udp
dev tun
ca cacert.crt
cert John.crt
key John.key
remote 5.6.7.8 1194
cipher BF-CBC
user nobody
group nobody
verb 2
comp-lzo
persist-key
persist-tun
float
nobind
If in the OpenVPN client config settings I enable Use default route, all traffic seems to hit the server, and Asterisk then works correctly.
I'd rather ONLY VPN traffic went via the server if possible but after a lot of head scratching I cannot see how to correct the issue.
I have added the OpenVPN network to 'local networks' in the server-manager and added it to the Asterisk config.
Some basic data (note ifconfig looks a bit odd due to the machine being a VM) :
'Local' network is 192.168.98.0
OpenVPN network 192.168.29.0
Ipsec VPN is 192.168.10.0
[root@asterisk init.d]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
1-2-3-4.re * 255.255.255.255 UH 0 0 0 eth0
192.168.98.0 * 255.255.255.0 U 0 0 0 eth1
192.168.29.0 * 255.255.255.0 U 0 0 0 tunvpn0
192.168.10.0 62-210-178-1.re 255.255.255.0 UG 0 0 0 eth0
default 1-2-3-4.re 0.0.0.0 UG 0 0 0 eth0
[root@asterisk httpd]# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:00:15:82
inet addr:5.6.7.8 Bcast:5.6.7.8 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1034853 errors:0 dropped:0 overruns:0 frame:0
TX packets:315289 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:160066951 (152.6 MiB) TX bytes:100450575 (95.7 MiB)
eth1 Link encap:Ethernet HWaddr 32:FB:06:61:A9:6D
inet addr:192.168.98.1 Bcast:192.168.98.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:600 errors:0 dropped:0 overruns:0 frame:0
TX packets:380 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:68014 (66.4 KiB) TX bytes:37469 (36.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:17868 errors:0 dropped:0 overruns:0 frame:0
TX packets:17868 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7053560 (6.7 MiB) TX bytes:7053560 (6.7 MiB)
tunvpn0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.29.1 P-t-P:192.168.29.1 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:31907 errors:0 dropped:0 overruns:0 frame:0
TX packets:4592 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4549875 (4.3 MiB) TX bytes:2016643 (1.9 MiB)
I can ping a client e.g. :
[root@asterisk httpd]# ping 192.168.29.2
PING 192.168.29.2 (192.168.29.2) 56(84) bytes of data.
64 bytes from 192.168.29.2: icmp_seq=1 ttl=64 time=61 ms
64 bytes from 192.168.29.2: icmp_seq=2 ttl=64 time=62 ms
tcpdump shows this when I have a call going on - I think the 100.x.x.x is a double natted IP from the carrier :
myserver.co.uk.12044 > 100.97.38.100.4000: UDP, length 172
But the IP of the phone from a web query gives 176.83.81.38
Any assistance appreciated - so close and yet so far !
B. Rgds
John
openvpn.conf as generated :
port 1194
proto udp
dev tunvpn0
user openvpn
group openvpn
chroot /etc/openvpn/routed
persist-key
persist-tun
# Certificates config
dh pub/dh.pem
ca pub/cacert.pem
cert pub/cert.pem
key priv/key.pem
tls-server
plugin /usr/lib64/openvpn/plugin/lib/openvpn-auth-pam.so login
server 192.168.29.0 255.255.255.0
topology subnet
up /etc/openvpn/routed/bin/up
script-security 2
# Options
keepalive 40 180
push "dhcp-option DOMAIN mydomain.co.uk"
push "dhcp-option DNS 192.168.98.1"
push "dhcp-option WINS 192.168.98.1"
mtu-test
mssfix
passtos
comp-lzo adaptive
push "comp-lzo adaptive"
nice 5
push "route 192.168.10.0 255.255.255.0 192.168.98.1"
push "route 192.168.98.0 255.255.255.0"
management 127.0.0.1 11195 management-pass.txt
client-config-dir ccd
status-version 2
status bridge-status.txt
suppress-timestamps
verb 3