I wanted to install OpenVPN server on rooted Android and found a solution on StackExchange. I rooted my phone, installed Linux Deploy, installed Ubuntu in it and compiled latest OpenVPN server and EasyRSA.

When I start OpenVPN server on my phone and I can connect to it with a client, but I can't ping anything but myself. Below is my server configuration (same configuration works fine if I set it up on real Ubuntu server):

# server 
# push "redirect-gateway def1 bypass-dhcp" 
# topology subnet 
# push "topology subnet"
# push "dhcp-option DNS" 
# push "dhcp-option DNS"
# duplicate-cn
# data-ciphers-fallback 'AES-256-CBC'
# keepalive 10 120 
# persist-key 
# persist-tun 
# explicit-exit-notify 1
# log-append /var/log/openvpn.log 
# verb 3

I haven't installed iptables or ufw so that's not a problem. My router LAN ip address is and my telephone ip address is (wlan0). My OpenVPN server is on (tun0) address and my OpenVPN client gets

On the StackExchange link I posted, guy said that Android ignores main table at all, so we should create custom rules and insert routes.

Without adding any routes to server, I can't even ping from my client, but when I add sudo ip route add dev tun0 table 5000 ping started working for and and that's it, I can't get to or any further.

I tried adding sudo ip route add dev wlan0 table 5000 but nothing changes.

I even tried sudo ip route add default dev wlan0 table 5000, but when I add that, I can't even connect from my client to my server any more.

Anyone have any idea how can I fix this?


You must log in to answer this question.

Browse other questions tagged .