justinstreet
I have an openvpn connection to a remote vpn (tun0) and am running openvpn server (tun1) on the same computer. I'd like any connected client's traffic to route through the tun0 connection like the computer in question would do if you were sitting in front of it and on the web. Now, I can get this to work just fine if I connect from my android phone when i'm connected to my lan via wifi. When I disable my wifi and go over the 4g network a connection can't even be established with the vpn server and nothing gets logged in syslog. If I stop the tun0 openvpn client connection I can connect from my android on the 4g network fine (but of course it won't route out my stopped tun0 connection which is what the goal is). Hopefully this makes some sense.
tun0 (client) config:
client
dev tun0
proto udp
remote 68.232.186.203 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/ca.crt
tls-client
remote-cert-tls server
comp-lzo
verb 5
reneg-sec 0
auth-user-pass /etc/openvpn/login.vpn
tun1 (server) config:
local 192.168.2.15
port 4201
proto udp
dev tun1
ca ca-magicbox.crt
cert magicbox-vpn.crt
key magicbox-vpn.key
dh dh1024.pem
server 10.20.30.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.20.30.0 255.255.255.0"
push "dhcp-option DNS 192.168.2.1"
push "redirect-gateway def1 bypass-dhcp"
client-to-client
keepalive 10 120
comp-lzo
user nobody
group nogroup
status openvpn-status.log
verb 6
Anybody know how to accomplish this or can help?
Thanks.
justinstreet
I know the traffic is at least getting to my computer.
I ran "tcpdump -i eth0 udp port 4201" from my android phone's 4g connection and it replied:
17:50:35.136639 IP 45.sub-70-XXX-XXX.myvzw.com.2064 > Magicbox.local.4201: UDP, length 14
17:50:37.041610 IP 45.sub-70-XXX-XXX.myvzw.com.2064 > Magicbox.local.4201: UDP, length 14
That, of course, was as far as it got. Next I connected to my wifi and ran the same command:
17:50:51.964877 IP myrouter.local.32932 > Magicbox.local.4201: UDP, length 14
17:50:51.965358 IP Magicbox.local.4201 > myrouter.local.32932: UDP, length 26
17:50:51.967367 IP myrouter.local.32932 > Magicbox.local.4201: UDP, length 26
This connected instantly to the VPN. So I guess I have some routing problem or something? Hopefully this is a big enough clue for someone to bail me out. Thanks.