Iso15118InternetVas¶
Handwritten Documentation¶
Warning
This module and its helper scripts are examples and not intended for
production use without modification. The provided vas-internet-setup.sh
script is a starting point and may not cover all edge cases for your
specific hardware and network environment. It is the user’s responsibility
to ensure the configuration is secure and robust.
This module implements the ISO 15118-2 Value Added Service (VAS) for providing internet access to a connected electric vehicle (EV). When an EV requests this service, the module configures the charger’s networking to share its internet connection with the EV over the power line communication (PLC) interface.
How it works¶
Service Announcement: The module advertises the availability of the Internet Access service (Service ID 3) to the EV, offering HTTP and/or HTTPS access based on the module’s configuration.
Service Selection: If the EV selects this service, the module initiates the network setup once the EV is authorized, as the ISO 15118 stack only reports the selection then ([V2G2-774] for ISO 15118-2).
Network Setup: The module executes a helper script,
vas-internet-setup.sh, to configure all necessary networking components. The script’s behavior depends on the configuration and the services selected by the EV:It enables IPv6 forwarding and sets up NAT using
ip6tables.If IPv4 support is enabled in the configuration, it also:
Starts a DHCPv4 server (
udhcpd) on the EV-facing network interface (ev_interface). This DHCP server provides the EV with an IPv4 address and DNS server information.Enables IPv4 forwarding and NAT using
iptables.
It starts a Router Advertisement Daemon (
radvd) on theev_interfaceto enable the EV to configure an IPv6 address using SLAAC. This also includes advertising Recursive DNS Servers (RDNSS) for IPv6.The module determines which ports to open based on the parameter sets (HTTP, HTTPS) selected by the EV. The EV may only reach public addresses via the
modem_interface, with TCP on the selected ports (80 for HTTP, 443 for HTTPS) and DNS to the announced resolvers; everything else it sends through the charger is dropped. Private, link-local and multicast ranges and the on-link prefixes of themodem_interfaceat session start are always blocked; other backend networks reachable via themodem_interfacewith public addresses are added withEXTRA_BLOCKED_DESTINATIONS_V4andEXTRA_BLOCKED_DESTINATIONS_V6in/etc/default/vas-internet.The example script uses public DNS servers (Google’s 8.8.8.8 for IPv4 and 2001:4860:4860::8888 for IPv6). They are set with
DNS_SERVERS_V4andDNS_SERVERS_V6in/etc/default/vas-internet; DNS to them is forwarded even when they are on a blocked network.
Session Teardown: When the charging session ends (signaled by the
evse_manager), the module calls the same script to automatically tear down the network configuration, stopping the services, removing all forwarding and NAT rules and restoring the previous forwarding setting.
Requirements¶
Software¶
The module relies on the vas-internet-setup.sh script, which requires the
following external tools to be available in the system’s PATH:
radvd: For IPv6 Router Advertisements.ip6tables: For setting up IPv6 NAT and forwarding rules.ip(from theiproute2package): For network interface configuration.iptables(optional, for IPv4): For IPv4 NAT and forwarding rules.udhcpd(optional, for IPv4): For the DHCPv4 server (typically provided by BusyBox).
The EVerest framework must be run with sufficient privileges to allow these
tools to modify network settings. This typically means running as the root
user.
Hardware¶
A working internet connection on the charging station.
A network interface that is connected to the internet (e.g.,
eth0,wwan0).A network interface for the Power Line Communication (PLC) modem that communicates with the EV (e.g., a HomePlug Green PHY modem connected via Ethernet).
Configuration¶
Key |
Description |
|---|---|
|
The name of the network interface connected to the EV via the PLC modem. |
|
The name of the network interface connected to the internet. |
|
(boolean) Whether to announce support for HTTP (Port 80). Defaults to true. |
|
(boolean) Whether to announce support for HTTPS (Port 443). Defaults to true. |
Example Configuration¶
- module: Iso15118InternetVas
config:
ev_interface: eth1
modem_interface: eth0
http_support: true
https_support: true
Provided Interfaces¶
iso15118_vas: Implements the
ISO15118_vasinterface to handle service discovery and selection from the EV.
Required Interfaces¶
evse_manager: The module optionally connects to an
evse_managerto monitor the charging session. When the session finishes, it triggers the teardown of the internet connection for the EV.