Setting up a VPN to connect a car
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.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVpn Newbie
- Posts: 5
- Joined: Sun May 08, 2022 10:05 pm
Setting up a VPN to connect a car
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
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
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Setting up a VPN to connect a car
What are the chances that Openvpn has --wait-for-car-to-reboot mode ?wiseminosse wrote: ↑Sun May 08, 2022 10:34 pmTo receive the programming codes, the cars needs to reboot, closing the connection channel.
-
- OpenVpn Newbie
- Posts: 5
- Joined: Sun May 08, 2022 10:05 pm
Re: Setting up a VPN to connect a car
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
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
-
- OpenVpn Newbie
- Posts: 5
- Joined: Sun May 08, 2022 10:05 pm
Re: Setting up a VPN to connect a car
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?
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
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
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Setting up a VPN to connect a car
You have a TAP Bridge in your cAr ?!??!?
Did you read the howto, yet .... ?
Did you read the howto, yet .... ?
-
- OpenVpn Newbie
- Posts: 5
- Joined: Sun May 08, 2022 10:05 pm
Re: Setting up a VPN to connect a car
Did you read my first post, yet... ?TinCanTech wrote: ↑Sat May 14, 2022 2:39 pmYou have a TAP Bridge in your cAr ?!??!?
Did you read the howto, yet .... ?
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Setting up a VPN to connect a car
It says nothing about the official OpenVPN Howto ..
-
- OpenVpn Newbie
- Posts: 5
- Joined: Sun May 08, 2022 10:05 pm
Re: Setting up a VPN to connect a car
It explains why I'm using a vpn in the car...
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Setting up a VPN to connect a car
If the laptop and car are connected via ethernet, why do you need a VPN ?