Sharing internet over adb
Install Openvpn on voxl2
You do need to connect voxl2 to the internet to install openvpn with sudo apt-get install openvpn
Technically you can get the deb file, adb push it over, and install it. But, eventually we can figure that out
Install Openvpn on laptop running Ubuntu
On Laptop
wget https://git.io/vpn -O openvpn-install.sh
sudo ./openvpn-install.shSettings
Which IPv4 address should be used? -> Doesn't matter what you select, changing it later
his server is behind NAT. What is the public IPv4 address or hostname? -> Hit Enter
Which protocol should OpenVPN use? -> Crucial to use TCP (adb reverse does not work over udp)
What port should OpenVPN listen to? -> Hit Enter
Select a DNS server for the clients: -> Any should work, but I use 2 (Google)
Enter a name for the first client: -> Whatever you want (I use voxl2)
Hit Enter to continue installation
Now we want to modify openvpn server configuration (since this is not a traditional vpn)
Open server configuration with
sudo vim /etc/openvpn/server/server.confDelete this top line

Or, just copy this content over
Restart the service:
sudo systemctl restart openvpn-server@serverEnsure everything loaded correctly with
sudo systemctl status openvpn-server@serverLast line should say "initializtion process complete"

Forward adb using reverse
We want to forward the port that we are VPNing over
adb reverse tcp:1194 tcp:1194
Configure client
Move over the config that was generated by the setup script
Change the remote ip addres in voxl2.ovpn to localhost (since we want all traffic to go to the adb reverse of localhost 1194)

Start forwarding traffic using openvpn --config voxl2.ovpn
It should look something like this

set default route
Now that we have a connection, we have to open a new window, adb in, and set the default path for all traffic to be forwarded to
sudo ip route add default via 10.8.0.1 dev tun0

set DNS
So, even though we can ping ip addresses we can not get DNS resolution. OpenVPN should be able to push DNS options, but for some reason this isnt working right now so I set them manually by adding the following to file /etc/resolv.conf

Conclusion
We should now be able to have full internet connetion

and even access voxl portal

Troubleshooting
Error with authenticating
Wed Jul 17 19:37:42 2024 VERIFY ERROR: depth=1, error=certificate is not yet valid: CN=Easy-RSA CA Wed Jul 17 19:37:42 2024 OpenSSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Wed Jul 17 19:37:42 2024 TLS_ERROR: BIO read tls_read_plaintext error Wed Jul 17 19:37:42 2024 TLS Error: TLS object -> incoming plaintext read error Wed Jul 17 19:37:42 2024 TLS Error: TLS handshake failed Wed Jul 17 19:37:42 2024 Fatal TLS error (check_tls_errors_co),
Solution: ensure the date is set correctly on the voxl2 with date and if it needs to be changed set it with date -s [insert current date]
Last updated