From 0ba30c744023fcf8354c8b58f656c6f84c5c9b58e4a1792475b870479da307e7 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 14 May 2026 15:25:48 -0400 Subject: [PATCH] Document the VLAN-id 0 special case. --- docs/add_net.md | 7 +++++++ docs/add_v4_net.md | 8 ++++++++ docs/add_v6_net.md | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/docs/add_net.md b/docs/add_net.md index a74fbdc..5cce43b 100644 --- a/docs/add_net.md +++ b/docs/add_net.md @@ -16,6 +16,12 @@ Adds an internal network segment with the specified vlan on the specified card. The created vlan-adaptor is put into the specified group. It is setup for both IPv4 and (where the ISP provides for it) IPv6. +If `${vlan}` is 0, then no tagged VLAN interfaces will be created; however, +the subnet address computations will still be performed as-if the vlan +were created. This means that `xy0` will use `0` or `00` for its subnet +computations in IPv4 and IPv6 respectively. If you don't intend to use +VLANs for subnets, just use VLAN ID 0 when declaring networks. + The IPv4 network will be a `/24` under `${v4_net_xy0}` if `${card}` is `xy0`, for example. If `${v4_net_xy0}` is not set, then `${v4_net}` is used by default. The 3rd octet will be `$(( ${vlan}/10 + ${vlan}%10 ))`. For @@ -50,6 +56,7 @@ IPv6, and VLAN ID. Each can be visually compared to the others.) |VLAN|IPv4 (3rd octet)|IPv6 suffix (hex)|Example IPv4 |Example IPv6 | |---:|---------------:|----------------:|--------------:|----------------------:| +| 0| 0 | 0 |192.168.0.0/24 |2001:db8:abcd:ef00::/64| | 7| 7 | 7 |192.168.7.0/24 |2001:db8:abcd:ef07::/64| | 101|11 | 11 |192.168.11.0/24|2001:db8:abcd:ef11::/64| | 205|25 | 25 |192.168.25.0/24|2001:db8:abcd:ef25::/64| diff --git a/docs/add_v4_net.md b/docs/add_v4_net.md index 1fb78f0..e304e88 100644 --- a/docs/add_v4_net.md +++ b/docs/add_v4_net.md @@ -16,6 +16,13 @@ Adds an internal network segment with the specified vlan on the specified card. The created vlan-adaptor is put into the specified group. It is setup for IPv4. +If `${vlan}` is 0, then no tagged VLAN interfaces will be created; however, +the subnet address computations will still be performed as-if the vlan +were created. This means that `xy0` will use `0` for its subnet +computations in IPv4. If you don't intend to use +VLANs for subnets, just use VLAN ID 0 when declaring networks. + + The IPv4 network will be a `/24` under `${v4_net_xy0}` if `${card}` is `xy0`, for example. If `${v4_net_xy0}` is not set, then `${v4_net}` is used by default. The 3rd octet will be `$(( ${vlan}/10 + ${vlan}%10 ))`. For @@ -36,6 +43,7 @@ IPv6, and VLAN ID. Each can be visually compared to the others.) |VLAN|IPv4 (3rd octet)|Example IPv4 | |---:|---------------:|--------------:| +| 0| 0 |192.168.0.0/24 | | 7| 7 |192.168.7.0/24 | | 101|11 |192.168.11.0/24| | 205|25 |192.168.25.0/24| diff --git a/docs/add_v6_net.md b/docs/add_v6_net.md index 337dbee..11d049a 100644 --- a/docs/add_v6_net.md +++ b/docs/add_v6_net.md @@ -16,6 +16,12 @@ Adds an internal network segment with the specified vlan on the specified card. The created vlan-adaptor is put into the specified group. It is setup for only IPv6. +If `${vlan}` is 0, then no tagged VLAN interfaces will be created; however, +the subnet address computations will still be performed as-if the vlan +were created. This means that `xy0` will use `00` for its subnet +computations in IPv6. If you don't intend to use +VLANs for subnets, just use VLAN ID 0 when declaring networks. + The IPv6 network will make `$(( ${vlan}/10 + ${vlan}%10 ))` into hex digits to be appended to the ISP's IPv6 prefix. This makes it compatible with the most common case of `/56` for most ISPs. If `no_ula` is specified in the @@ -46,6 +52,7 @@ IPv6 and VLAN ID. Each can be visually compared to the other.) |VLAN|IPv6 suffix (hex)|Example IPv6 | |---:|----------------:|----------------------:| +| 0| 0 |2001:db8:abcd:ef00::/64| | 7| 7 |2001:db8:abcd:ef07::/64| | 101| 11 |2001:db8:abcd:ef11::/64| | 205| 25 |2001:db8:abcd:ef25::/64|