Setting up a VPN to connect a car

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
wiseminosse
OpenVpn Newbie
Posts: 5
Joined: Sun May 08, 2022 10:05 pm

Setting up a VPN to connect a car

Post by wiseminosse » Sun May 08, 2022 10:34 pm

I'm working on an open project to remotely connect a diagnostic tool to a car, through OpenVPN.
The car is designed to accept Ethernet connections through an OBD to Ethernet adapter.
The connection is supposed to be established according to the APIPA protocol (169.254.x.x)
So I made an OpenVPN setup in bridge mode within 169.254.x.x address range, with the Ethernet interface bridged with the OpenVPN tap.
The laptop attached to the car runs an OpenVPN server, with the Ethernet interface attached to the car and a wifi connection to go on internet.
The other end is run over a laptop with the OpenVPN client and the diagnostic tool
When both ends are connected, after about 15-30 seconds, the remote end receives the DoIP broadcast messages sent by the vehicle and the diagnostic session can start.
So far, so good.
Unfortunately, there is an issue when trying to put the car in programming mode.
To receive the programming codes, the cars needs to reboot, closing the connection channel.
When coming back in programming mode, it needs to establish the communication with the diagnostic tool within a timeout (about 20 s), otherwise it reboots again and comes back to normal mode.
And here is my issue: the OpenVPN setup doesn't always allow to promptly broadcast the Ethernet packets to the other end of the tunnel so that the diagnostic tool can manage the programming phase, and the car reboots back in normal mode.

Here is the OpenVPN setup I'm talking about
https://www.swedespeed.com/threads/remote-vida.654016/

I would be grateful to anybody that could help me to speedup the car reconnection phase

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Setting up a VPN to connect a car

Post by TinCanTech » Mon May 09, 2022 12:05 am

wiseminosse wrote:
Sun May 08, 2022 10:34 pm
To receive the programming codes, the cars needs to reboot, closing the connection channel.
What are the chances that Openvpn has --wait-for-car-to-reboot mode ?

wiseminosse
OpenVpn Newbie
Posts: 5
Joined: Sun May 08, 2022 10:05 pm

Re: Setting up a VPN to connect a car

Post by wiseminosse » Mon May 09, 2022 5:49 am

It could be promising :-)

I'll try to better elaborate to be more clear
When the car closes the Ethernet connection, the ethernet interface goes down and, to be up again, it needs to repeat the APIPA procedure .
When directly connected to tool, the entire setup procedure takes 5-10 seconds, when bridged with the OpenVPN tap interface, it could exceed 20-30 seconds before the remote end can detect the car.
This gap is my issue

wiseminosse
OpenVpn Newbie
Posts: 5
Joined: Sun May 08, 2022 10:05 pm

Re: Setting up a VPN to connect a car

Post by wiseminosse » Sat May 14, 2022 12:55 pm

This is the setup I'm using.
tap-bridge is a Windows bridge that joins eth and tap
Address is allocated on apipa range so that the car car be seen
The car is visible to the remote end after 30 seconds after being connected
My budget is within 20 seconds

What can I change to speed up the discovery on the remote end?

Server on car side

proto udp
port 56421
dev tap
dev-node tap-bridge
keepalive 10 120
server-bridge 169.254.15.1 255.255.0.0 169.254.15.2 169.254.15.10
persist-tun
persist-local-ip
persist-remote-ip
verb 4
status openvpn-status.log


TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Setting up a VPN to connect a car

Post by TinCanTech » Sat May 14, 2022 2:39 pm

You have a TAP Bridge in your cAr ?!??!?

Did you read the howto, yet .... ?

wiseminosse
OpenVpn Newbie
Posts: 5
Joined: Sun May 08, 2022 10:05 pm

Re: Setting up a VPN to connect a car

Post by wiseminosse » Sun May 15, 2022 2:00 pm

TinCanTech wrote:
Sat May 14, 2022 2:39 pm
You have a TAP Bridge in your cAr ?!??!?

Did you read the howto, yet .... ?
Did you read my first post, yet... ?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Setting up a VPN to connect a car

Post by TinCanTech » Sun May 15, 2022 3:09 pm

wiseminosse wrote:
Sun May 15, 2022 2:00 pm
Did you read my first post, yet... ?
It says nothing about the official OpenVPN Howto ..

wiseminosse
OpenVpn Newbie
Posts: 5
Joined: Sun May 08, 2022 10:05 pm

Re: Setting up a VPN to connect a car

Post by wiseminosse » Mon May 16, 2022 8:27 pm

TinCanTech wrote:
Sun May 15, 2022 3:09 pm
It says nothing about the official OpenVPN Howto ..
It explains why I'm using a vpn in the car...

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Setting up a VPN to connect a car

Post by TinCanTech » Mon May 16, 2022 9:57 pm

If the laptop and car are connected via ethernet, why do you need a VPN ?

Post Reply