Tunnel Setup #
The Tunnel Security Levels #
The tunnel HMAC/encrytion parameter shortcode consists of two parts:
- The Tunnel HMAC Level
- H0 - default authentication
- H1 - authentication with a secret (
tunnel-hmac-secret
is set) - H2 - authentication with a 2^32 rotating random secret (
tunnel-hmac-material
is set) - H3 - authentication with both XORed (both,
tunnel-hmac-secret
andtunnel-hmac-material
are set)
- The Tunnel Encryption Level
- E0 - no encryption
- E1 - encryption with a preshared key (
tunnel-key-secret
is set) - E2 - encryption with a 2^32 rotating random key (
tunnel-key-material
is set) - E3 - authentication with both XORed (both,
tunnel-key-secret
andtunnel-key-material
are set)
Both combined result in 16 possible tunnel security levels to choose from, the corresponding shortcode ranges from H0E0 to H3E3.
The Registry Security Levels #
For communication with a EtherTunnel registry there are the following possibilities:
- The Registry HMAC Level
- H0 - default authentication
- H1 - authentication with a secret (
tunnel-registry-secret
is set)
- The Tunnel Encryption Level
- E0 - no encryption
- E1 - encryption with a preshared key (
tunnel-registry-secret
is set)
Both combined result in 4 possible registry security levels ranging from H0E0 to H1E1. The registry security level shortcode exists implicitly and does not appear as such in the CLI or in the EtherTunnel log messages.
Generating random material from /dev/urandom #
A shared random material file for tunnel-hmac-material
and
tunnel-key-material
requires 32KB of random data (the file may be larger).
To generate this with dd
works like this:
$ dd if=/dev/urandom bs=32768 count=1 > material.random
1+0 records in
1+0 records out
32768 bytes (33 kB, 32 KiB) copied, 0.000121559 s, 270 MB/s
If available you may of course use your TRNG device instead.
Examples #
The basic H0E0 Tunnel #
This example establishes a tunnel using the default HMAC authentication
with encryption switched off. Both peers know each other, the Ethernet
LANs connected to enp1s0f0
on each side are connected as with an
Ethernet cable as soon as the tunnel is established.
Side A #
|
|
Side B #
|
|
An H1E1 Tunnel with an additional VLAN #
This configuration establishes a H1E1 tunnel and additionally
transports VLAN 20. The 8021q
module takes care of the tagging/untagging.
Side A #
|
|
Side B #
|
|
H2E2 Tunnel with two VLANs and Registry fallback #
This configuration configures a H2E2 tunnel and transports
VLAN 20 and VLAN 21. As long as the tunnel is not established,
the registry myregistry.example.com
is additionally consulted to find a
peer with the tunnel name “TestConnection” (which has to be present and
the same on both sides).
Side A #
|
|
Side B #
|
|
The matching H0E0 Registry #
To start the H0E0 registry for this example executing a ethtun start
on myregistry.example.com
with no or an empty configuration is all
that’s required.
H3E3 Tunnel Registry only with Filters #
In this example both endpoints do not know each other, so the registry
myregistry.example.com
is consulted to find the peer for the tunnel
name TestConnection
. The authentication towards the registry
Side A #
|
|
Side B #
|
|
The matching H1E0 Registry #
The configuration of the registry running on myregistry.example.com
just needs
the matching parameter registry-hmac-secret
configured in that case:
|
|