# Family ovpn netlink specification

_Peios Kernel / Internals / Netlink / specs_

> Protocol reference for the ovpn Netlink family, generated from the Peios kernel specification.

<!-- SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) -->


<a id="rst-family-ovpn-netlink-specification"></a>
<a id="rst-netlink-ovpn"></a>

<!-- SPDX-License-Identifier: GPL-2.0 -->

<a id="rst-summary"></a>



## Summary



Netlink protocol to control OpenVPN network devices

<a id="rst-operations"></a>



## Operations

<a id="rst-peer-new"></a>
<a id="rst-ovpn-operation-peer-new"></a>



### peer-new



Add a remote peer

- **attribute-set**:

  [ovpn-peer-new-input](#rst-ovpn-attribute-set-ovpn-peer-new-input)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `peer`\]

<a id="rst-peer-set"></a>
<a id="rst-ovpn-operation-peer-set"></a>



### peer-set



modify a remote peer

- **attribute-set**:

  [ovpn-peer-set-input](#rst-ovpn-attribute-set-ovpn-peer-set-input)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `peer`\]

<a id="rst-peer-get"></a>
<a id="rst-ovpn-operation-peer-get"></a>



### peer-get



Retrieve data about existing remote peers (or a specific one)

- **attribute-set**:

  [ovpn](#rst-ovpn-attribute-set-ovpn)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `peer`\]

  **reply**

  - **attributes**:

    \[`peer`\]

- **dump**:

  **request**

  - **attributes**:

    \[`ifindex`\]

  **reply**

  - **attributes**:

    \[`peer`\]

<a id="rst-peer-del"></a>
<a id="rst-ovpn-operation-peer-del"></a>



### peer-del



Delete existing remote peer

- **attribute-set**:

  [ovpn-peer-del-input](#rst-ovpn-attribute-set-ovpn-peer-del-input)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `peer`\]

<a id="rst-peer-del-ntf"></a>
<a id="rst-ovpn-operation-peer-del-ntf"></a>



### peer-del-ntf



Notification about a peer being deleted

- **notify**:

  peer-get

- **mcgrp**:

  peers

<a id="rst-key-new"></a>
<a id="rst-ovpn-operation-key-new"></a>



### key-new



Add a cipher key for a specific peer

- **attribute-set**:

  [ovpn](#rst-ovpn-attribute-set-ovpn)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `keyconf`\]

<a id="rst-key-get"></a>
<a id="rst-ovpn-operation-key-get"></a>



### key-get



Retrieve non-sensitive data about peer key and cipher

- **attribute-set**:

  [ovpn-keyconf-get](#rst-ovpn-attribute-set-ovpn-keyconf-get)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `keyconf`\]

  **reply**

  - **attributes**:

    \[`keyconf`\]

<a id="rst-key-swap"></a>
<a id="rst-ovpn-operation-key-swap"></a>



### key-swap



Swap primary and secondary session keys for a specific peer

- **attribute-set**:

  [ovpn-keyconf-swap-input](#rst-ovpn-attribute-set-ovpn-keyconf-swap-input)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `keyconf`\]

<a id="rst-key-swap-ntf"></a>
<a id="rst-ovpn-operation-key-swap-ntf"></a>



### key-swap-ntf



Notification about key having exhausted its IV space and requiring renegotiation

- **notify**:

  key-get

- **mcgrp**:

  peers

<a id="rst-key-del"></a>
<a id="rst-ovpn-operation-key-del"></a>



### key-del



Delete cipher key for a specific peer

- **attribute-set**:

  [ovpn-keyconf-del-input](#rst-ovpn-attribute-set-ovpn-keyconf-del-input)

- **flags**:

  \[`admin-perm`\]

- **do**:

  **pre**



  ovpn-nl-pre-doit

  **post**



  ovpn-nl-post-doit

  **request**

  - **attributes**:

    \[`ifindex`, `keyconf`\]

<a id="rst-multicast-groups"></a>



## Multicast groups

- peers


<a id="rst-definitions"></a>



## Definitions

<a id="rst-nonce-tail-size"></a>
<a id="rst-ovpn-definition-nonce-tail-size"></a>



### nonce-tail-size

- **type**:

  const

- **value**:

  8

<a id="rst-cipher-alg"></a>
<a id="rst-ovpn-definition-cipher-alg"></a>



### cipher-alg

- **type**:

  enum

- **entries**:

  - `none`


  - `aes-gcm`


  - `chacha20-poly1305`

<a id="rst-del-peer-reason"></a>
<a id="rst-ovpn-definition-del-peer-reason"></a>



### del-peer-reason

- **type**:

  enum

- **entries**:

  - `teardown`


  - `userspace`


  - `expired`


  - `transport-error`


  - `transport-disconnect`

<a id="rst-key-slot"></a>
<a id="rst-ovpn-definition-key-slot"></a>



### key-slot

- **type**:

  enum

- **entries**:

  - `primary`


  - `secondary`

<a id="rst-attribute-sets"></a>



## Attribute sets

<a id="rst-peer"></a>
<a id="rst-ovpn-attribute-set-peer"></a>



### peer

<a id="rst-id-u32"></a>



#### id (`u32`)

- **doc**:

  The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device

<a id="rst-remote-ipv4-u32"></a>



#### remote-ipv4 (`u32`)

- **doc**:

  The remote IPv4 address of the peer

- **byte-order**:

  big-endian

- **display-hint**:

  ipv4

<a id="rst-remote-ipv6-binary"></a>



#### remote-ipv6 (`binary`)

- **doc**:

  The remote IPv6 address of the peer

- **display-hint**:

  ipv6

<a id="rst-remote-ipv6-scope-id-u32"></a>



#### remote-ipv6-scope-id (`u32`)

- **doc**:

  The scope id of the remote IPv6 address of the peer (RFC2553)

<a id="rst-remote-port-u16"></a>



#### remote-port (`u16`)

- **doc**:

  The remote port of the peer

- **byte-order**:

  big-endian

<a id="rst-socket-u32"></a>



#### socket (`u32`)

- **doc**:

  The socket to be used to communicate with the peer

<a id="rst-socket-netnsid-s32"></a>



#### socket-netnsid (`s32`)

- **doc**:

  The ID of the netns the socket assigned to this peer lives in

<a id="rst-vpn-ipv4-u32"></a>



#### vpn-ipv4 (`u32`)

- **doc**:

  The IPv4 address assigned to the peer by the server

- **byte-order**:

  big-endian

- **display-hint**:

  ipv4

<a id="rst-vpn-ipv6-binary"></a>



#### vpn-ipv6 (`binary`)

- **doc**:

  The IPv6 address assigned to the peer by the server

- **display-hint**:

  ipv6

<a id="rst-local-ipv4-u32"></a>



#### local-ipv4 (`u32`)

- **doc**:

  The local IPv4 to be used to send packets to the peer (UDP only)

- **byte-order**:

  big-endian

- **display-hint**:

  ipv4

<a id="rst-local-ipv6-binary"></a>



#### local-ipv6 (`binary`)

- **doc**:

  The local IPv6 to be used to send packets to the peer (UDP only)

- **display-hint**:

  ipv6

<a id="rst-local-port-u16"></a>



#### local-port (`u16`)

- **doc**:

  The local port to be used to send packets to the peer (UDP only)

- **byte-order**:

  big-endian

<a id="rst-keepalive-interval-u32"></a>



#### keepalive-interval (`u32`)

- **doc**:

  The number of seconds after which a keep alive message is sent to the peer

<a id="rst-keepalive-timeout-u32"></a>



#### keepalive-timeout (`u32`)

- **doc**:

  The number of seconds from the last activity after which the peer is assumed dead

<a id="rst-del-reason-u32"></a>



#### del-reason (`u32`)

- **doc**:

  The reason why a peer was deleted

- **enum**:

  [del-peer-reason](#rst-ovpn-definition-del-peer-reason)

<a id="rst-vpn-rx-bytes-uint"></a>



#### vpn-rx-bytes (`uint`)

- **doc**:

  Number of bytes received over the tunnel

<a id="rst-vpn-tx-bytes-uint"></a>



#### vpn-tx-bytes (`uint`)

- **doc**:

  Number of bytes transmitted over the tunnel

<a id="rst-vpn-rx-packets-uint"></a>



#### vpn-rx-packets (`uint`)

- **doc**:

  Number of packets received over the tunnel

<a id="rst-vpn-tx-packets-uint"></a>



#### vpn-tx-packets (`uint`)

- **doc**:

  Number of packets transmitted over the tunnel

<a id="rst-link-rx-bytes-uint"></a>



#### link-rx-bytes (`uint`)

- **doc**:

  Number of bytes received at the transport level

<a id="rst-link-tx-bytes-uint"></a>



#### link-tx-bytes (`uint`)

- **doc**:

  Number of bytes transmitted at the transport level

<a id="rst-link-rx-packets-uint"></a>



#### link-rx-packets (`uint`)

- **doc**:

  Number of packets received at the transport level

<a id="rst-link-tx-packets-uint"></a>



#### link-tx-packets (`uint`)

- **doc**:

  Number of packets transmitted at the transport level

<a id="rst-peer-new-input"></a>
<a id="rst-ovpn-attribute-set-peer-new-input"></a>



### peer-new-input

<a id="rst-id"></a>



#### id

<a id="rst-remote-ipv4"></a>



#### remote-ipv4

<a id="rst-remote-ipv6"></a>



#### remote-ipv6

<a id="rst-remote-ipv6-scope-id"></a>



#### remote-ipv6-scope-id

<a id="rst-remote-port"></a>



#### remote-port

<a id="rst-socket"></a>



#### socket

<a id="rst-vpn-ipv4"></a>



#### vpn-ipv4

<a id="rst-vpn-ipv6"></a>



#### vpn-ipv6

<a id="rst-local-ipv4"></a>



#### local-ipv4

<a id="rst-local-ipv6"></a>



#### local-ipv6

<a id="rst-keepalive-interval"></a>



#### keepalive-interval

<a id="rst-keepalive-timeout"></a>



#### keepalive-timeout

<a id="rst-peer-set-input"></a>
<a id="rst-ovpn-attribute-set-peer-set-input"></a>



### peer-set-input

<a id="rst-id-1"></a>



#### id

<a id="rst-remote-ipv4-1"></a>



#### remote-ipv4

<a id="rst-remote-ipv6-1"></a>



#### remote-ipv6

<a id="rst-remote-ipv6-scope-id-1"></a>



#### remote-ipv6-scope-id

<a id="rst-remote-port-1"></a>



#### remote-port

<a id="rst-vpn-ipv4-1"></a>



#### vpn-ipv4

<a id="rst-vpn-ipv6-1"></a>



#### vpn-ipv6

<a id="rst-local-ipv4-1"></a>



#### local-ipv4

<a id="rst-local-ipv6-1"></a>



#### local-ipv6

<a id="rst-keepalive-interval-1"></a>



#### keepalive-interval

<a id="rst-keepalive-timeout-1"></a>



#### keepalive-timeout

<a id="rst-peer-del-input"></a>
<a id="rst-ovpn-attribute-set-peer-del-input"></a>



### peer-del-input

<a id="rst-id-2"></a>



#### id

<a id="rst-keyconf"></a>
<a id="rst-ovpn-attribute-set-keyconf"></a>



### keyconf

<a id="rst-peer-id-u32"></a>



#### peer-id (`u32`)

- **doc**:

  The unique ID of the peer in the device context. To be used to identify peers during key operations

<a id="rst-slot-u32"></a>



#### slot (`u32`)

- **doc**:

  The slot where the key should be stored

- **enum**:

  [key-slot](#rst-ovpn-definition-key-slot)

<a id="rst-key-id-u32"></a>



#### key-id (`u32`)

- **doc**:

  The unique ID of the key in the peer context. Used to fetch the correct key upon decryption

<a id="rst-cipher-alg-u32"></a>



#### cipher-alg (`u32`)

- **doc**:

  The cipher to be used when communicating with the peer

- **enum**:

  [cipher-alg](#rst-ovpn-definition-cipher-alg)

<a id="rst-encrypt-dir-nest"></a>



#### encrypt-dir (`nest`)

- **doc**:

  Key material for encrypt direction

- **nested-attributes**:

  [keydir](#rst-ovpn-attribute-set-keydir)

<a id="rst-decrypt-dir-nest"></a>



#### decrypt-dir (`nest`)

- **doc**:

  Key material for decrypt direction

- **nested-attributes**:

  [keydir](#rst-ovpn-attribute-set-keydir)

<a id="rst-keydir"></a>
<a id="rst-ovpn-attribute-set-keydir"></a>



### keydir

<a id="rst-cipher-key-binary"></a>



#### cipher-key (`binary`)

- **doc**:

  The actual key to be used by the cipher

<a id="rst-nonce-tail-binary"></a>



#### nonce-tail (`binary`)

- **doc**:

  Random nonce to be concatenated to the packet ID, in order to obtain the actual cipher IV

<a id="rst-keyconf-get"></a>
<a id="rst-ovpn-attribute-set-keyconf-get"></a>



### keyconf-get

<a id="rst-peer-id"></a>



#### peer-id

<a id="rst-slot"></a>



#### slot

<a id="rst-key-id"></a>



#### key-id

<a id="rst-cipher-alg-1"></a>



#### cipher-alg

<a id="rst-keyconf-swap-input"></a>
<a id="rst-ovpn-attribute-set-keyconf-swap-input"></a>



### keyconf-swap-input

<a id="rst-peer-id-1"></a>



#### peer-id

<a id="rst-keyconf-del-input"></a>
<a id="rst-ovpn-attribute-set-keyconf-del-input"></a>



### keyconf-del-input

<a id="rst-peer-id-2"></a>



#### peer-id

<a id="rst-slot-1"></a>



#### slot

<a id="rst-ovpn"></a>
<a id="rst-ovpn-attribute-set-ovpn"></a>



### ovpn

<a id="rst-ifindex-u32"></a>



#### ifindex (`u32`)

- **doc**:

  Index of the ovpn interface to operate on

<a id="rst-peer-nest"></a>



#### peer (`nest`)

- **doc**:

  The peer object containing the attributed of interest for the specific operation

- **nested-attributes**:

  [peer](#rst-ovpn-attribute-set-peer)

<a id="rst-keyconf-nest"></a>



#### keyconf (`nest`)

- **doc**:

  Peer specific cipher configuration

- **nested-attributes**:

  [keyconf](#rst-ovpn-attribute-set-keyconf)

<a id="rst-ovpn-peer-new-input"></a>
<a id="rst-ovpn-attribute-set-ovpn-peer-new-input"></a>



### ovpn-peer-new-input

<a id="rst-ifindex"></a>



#### ifindex

<a id="rst-peer-1"></a>



#### peer

- **nested-attributes**:

  [peer-new-input](#rst-ovpn-attribute-set-peer-new-input)

<a id="rst-ovpn-peer-set-input"></a>
<a id="rst-ovpn-attribute-set-ovpn-peer-set-input"></a>



### ovpn-peer-set-input

<a id="rst-ifindex-1"></a>



#### ifindex

<a id="rst-peer-2"></a>



#### peer

- **nested-attributes**:

  [peer-set-input](#rst-ovpn-attribute-set-peer-set-input)

<a id="rst-ovpn-peer-del-input"></a>
<a id="rst-ovpn-attribute-set-ovpn-peer-del-input"></a>



### ovpn-peer-del-input

<a id="rst-ifindex-2"></a>



#### ifindex

<a id="rst-peer-3"></a>



#### peer

- **nested-attributes**:

  [peer-del-input](#rst-ovpn-attribute-set-peer-del-input)

<a id="rst-ovpn-keyconf-get"></a>
<a id="rst-ovpn-attribute-set-ovpn-keyconf-get"></a>



### ovpn-keyconf-get

<a id="rst-ifindex-3"></a>



#### ifindex

<a id="rst-keyconf-1"></a>



#### keyconf

- **nested-attributes**:

  [keyconf-get](#rst-ovpn-attribute-set-keyconf-get)

<a id="rst-ovpn-keyconf-swap-input"></a>
<a id="rst-ovpn-attribute-set-ovpn-keyconf-swap-input"></a>



### ovpn-keyconf-swap-input

<a id="rst-ifindex-4"></a>



#### ifindex

<a id="rst-keyconf-2"></a>



#### keyconf

- **nested-attributes**:

  [keyconf-swap-input](#rst-ovpn-attribute-set-keyconf-swap-input)

<a id="rst-ovpn-keyconf-del-input"></a>
<a id="rst-ovpn-attribute-set-ovpn-keyconf-del-input"></a>



### ovpn-keyconf-del-input

<a id="rst-ifindex-5"></a>



#### ifindex

<a id="rst-keyconf-3"></a>



#### keyconf

- **nested-attributes**:

  [keyconf-del-input](#rst-ovpn-attribute-set-keyconf-del-input)
