I installed openvpn server on a debian 11 server virtual machine (VirtualBox) on an ubuntu 22.04 LTS server host. using this script:
https://raw.githubusercontent.com/Nyr/o ... install.sh .
I installed the openvpnclient on an android phone and imported the ovpn file generated by the install script.
forwarded port 1194 on my router to the vm.
The phone now connects to the server fine. Both from local LAN and WAN. Browsing my smb shares and connecting to internet works fine from LAN (wifi enabled on the phone). However, when I disable wifi and connect through my mobile network it will still connect fine, but accessing smb shares and internet websites will fail most of the times. Pinging google.com gave no errors and no lost packages.
I am new to vpn and clueless. Any help to point me in the right direction will be appreciated.
Connection problems on mobile network
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
- buggy
- OpenVpn Newbie
- Posts: 5
- Joined: Wed May 17, 2023 12:50 pm
Connection problems on mobile network
Last edited by buggy on Wed May 17, 2023 3:18 pm, edited 1 time in total.
- Pippin
- Forum Team
- Posts: 1201
- Joined: Wed Jul 01, 2015 8:03 am
- Location: irc://irc.libera.chat:6697/openvpn
Re: Unstable connection from WAN
Could it be that samba rejects traffic coming from a different subnet then itself resides on?
If so, it seems you need to allow that/those subnet(s):
https://www.oreilly.com/openbook/samba/ ... 04_06.html
If so, it seems you need to allow that/those subnet(s):
https://www.oreilly.com/openbook/samba/ ... 04_06.html
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
Halton Arp
- buggy
- OpenVpn Newbie
- Posts: 5
- Joined: Wed May 17, 2023 12:50 pm
Re: Connection problems on mobile network
Please correct me if i am wrong, but I assumed the ip reported to samba would be the ip of tun0. So the subnet would be the same on LAN and WAN.Pippin wrote: ↑Wed May 17, 2023 1:48 pmCould it be that samba rejects traffic coming from a different subnet then itself resides on?
If so, it seems you need to allow that/those subnet(s):
https://www.oreilly.com/openbook/samba/ ... 04_06.html
Last edited by buggy on Wed May 17, 2023 3:20 pm, edited 1 time in total.
- buggy
- OpenVpn Newbie
- Posts: 5
- Joined: Wed May 17, 2023 12:50 pm
Re: Connection problems on mobile network
I did some investigation on the mobile network. "ip a" command returns 192.0.0.4 and an ip check online returns 77.63.xx.xxx . So it seems the mobile network is behind a nat router. Now it makes sense I have Issues.
I will try a different wifi network and see if it will work there
Still looking for a solution. The whole point of my vpn server is to connect to my home network on the road using the phones hotspot.
I guess have to change The subject title
I will try a different wifi network and see if it will work there
Still looking for a solution. The whole point of my vpn server is to connect to my home network on the road using the phones hotspot.
I guess have to change The subject title
- buggy
- OpenVpn Newbie
- Posts: 5
- Joined: Wed May 17, 2023 12:50 pm
Re: Connection problems on mobile network
I did a test on a friends wifi network and everything worked fine on both the android and a windows client. So this is not a samba configuration issue. Also the basic configuration of openvpn on both the server and the client seems okay.
I am still in the dark what to do about the bad connection on the mobile network.
I am using the udp protocol. I will change that to tcp. Maybe it will help if the server gets some feedback about lost packets.
I am still in the dark what to do about the bad connection on the mobile network.
I am using the udp protocol. I will change that to tcp. Maybe it will help if the server gets some feedback about lost packets.
Last edited by buggy on Fri May 19, 2023 12:10 am, edited 1 time in total.
- buggy
- OpenVpn Newbie
- Posts: 5
- Joined: Wed May 17, 2023 12:50 pm
Re: Connection problems on mobile network
Switched from udp to tcp. Connection is fine now, so I think guessed right.
Problem solved for now.
Problem solved for now.
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Feb 15, 2024 8:37 am
Re: Connection problems on mobile network
I'm fighting the same issue and as I currently own a spare mobile carrier connectivity, I've discovered that using the mobile network of one of the mobile carrier, my VPN works fine both using UDP and TCP whereas the other ISP mobile network works only using TCP protocol.buggy wrote: ↑Wed May 17, 2023 3:09 pmI did some investigation on the mobile network. "ip a" command returns 192.0.0.4 and an ip check online returns 77.63.xx.xxx . So it seems the mobile network is behind a nat router. Now it makes sense I have Issues.
I will try a different wifi network and see if it will work there
Still looking for a solution. The whole point of my vpn server is to connect to my home network on the road using the phones hotspot.
I guess have to change The subject title
This happens on Android version 14 and "OpenVPN Connect" app version 3.4.0.
Client side, the "OpenVPN Connect" app logs does not show any relevant clue, just a connection timeout message. I've also tested that there where no problems trying to send and receive UDP packets on Android using a terminal app.
Server side, during my tests, I've found that:
Code: Select all
tcpdump -ni <my_network_interface> udp and port <my_openvpn_listening_port>
Temporarily solved using TCP, altough connection seems generally very slow.
A further test demonstrates that using the mobile carrier which as stated above worked only in TCP mode, also works using UDP protocol with a Linux laptop configured as OpenVPN client, connected throught the Android phone used as mobile wifi hotspot.
This seems really no-sense, I can only think of the involved mobile carrier blocking some packets for some unknown reason.