Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IVpnManager

interface IVpnManager
Extends com.amazon.apmf.IStandard Base interface for managing VPN connections. Provides generic VPN operations that are common across all VPN types.

Methods

createVpn()

void createVpn(com.amazon.kepler.net.vpn.common.VpnConfig* config)
Creates a VPN interface with the provided configuration. The interface name will be defined by the system. Applications should listen for VPN interface up events to be notified when the interface is ready.

Parameters

config
com.amazon.kepler.net.vpn.common.VpnConfig* — Required The VPN configuration containing interface settings, routing rules, and protocol-specific configuration (only WireGuard for now). Must not be null.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

getVpnConfig()

com.amazon.kepler.net.vpn.common.VpnConfig? getVpnConfig()
Get the current VPN configuration.

Returns

com.amazon.kepler.net.vpn.common.VpnConfig? The return value is optional and might be absent. The current VPN configuration or null if none exists.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

getVpnState()

com.amazon.kepler.net.vpn.common.VpnState getVpnState()
Get the current VPN state.

Returns

com.amazon.kepler.net.vpn.common.VpnState The current VPN state.

Throws

Requires com.amazon.network.privilege.network-access

addDnsServer()

void addDnsServer(string ipAddr)
Adds a DNS server to the VPN connection. Must be called at INTF_UP state after createVpn and before startVpn.

Parameters

ipAddr
string — Required The IP address of the DNS server in standard notation (e.g. “192.168.1.1” for IPv4 or “2001:db8::1” for IPv6)

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

addRoute()

void addRoute(string ipAddr)
Add a network route to the VPN interface. Both IPv4 and IPv6 routes are supported. Adding a route implicitly allows traffic from that address family (i.e., IPv4 or IPv6) to be routed over the VPN. Must be called at INTF_UP state after createVpn and before startVpn.

Parameters

ipAddr
string — Required The IP address with prefix to add as a route.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

deleteRoute()

void deleteRoute(string ipAddr)
Exclude a network route from the VPN interface. Both IPv4 and IPv6 routes are supported. Must be called at INTF_UP state after createVpn and before startVpn.

Parameters

ipAddr
string — Required The IP address with prefix to exclude as a route.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

addInterfaceAddress()

void addInterfaceAddress(string ipAddr)
Add a network address to the VPN interface. Both IPv4 and IPv6 addresses are supported. At least one address must be set before starting the VPN.

Parameters

ipAddr
string — Required The IP address with prefix to add to the interface.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

deleteInterfaceAddress()

void deleteInterfaceAddress(string ipAddr)
Remove a network address from the VPN interface. Must be called at INTF_UP state after createVpn and before startVpn.

Parameters

ipAddr
string — Required The IP address with prefix to remove from the interface.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

setMtu()

void setMtu(u16 mtu)
Set the maximum transmission unit (MTU) of the VPN interface.

Parameters

mtu
u16 — Required The MTU value to set.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

startVpn()

void startVpn()
Start the VPN connection. Sets up the VPN connection.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

stopVpn()

void stopVpn()
Stop the VPN connection. Tears down the VPN connection.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

addVpnEventListener()

void addVpnEventListener(IVpnEventListener* listener)
Register a listener for VPN events.

Parameters

listener
IVpnEventListener* — Required The listener to register.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl

removeVpnEventListener()

void removeVpnEventListener()
Unregister the VPN event listener.

Throws

Requires com.amazon.network.privilege.net-vpn-ctrl
Last modified on October 29, 2026