Merge pull request #1043 from mslacken/MultipleNetworks

Documentation for mulitple networks
This commit is contained in:
Jonathon Anderson
2024-02-17 02:12:34 -07:00
committed by GitHub
3 changed files with 131 additions and 0 deletions

View File

@@ -151,6 +151,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Check if commas are allowes in node/profile set
- Removed paths.tftpdir and paths.datadir
- Updated WW_INTERNAL to 45 for upcoming 4.5.x release
- Added documentation about of how to configure warewulf with
multiple networks
## [4.4.0] 2023-01-18

View File

@@ -242,6 +242,24 @@ To configure a bonded (link aggreagtion) network interface the following command
Note: the netnames of the member interterfaces need to match the "netname" of the bonded interface until the first "_" (in the example bond0)
Additional networks
-------------------
Additional networks for the node can also be configured.
You will have provide all the necessary network information.
.. code-block:: shell
wwctl node set \
--netdev ib0 \
--hwaddr aa:bb:cc:dd:ee:ff \
--ipaddr 10.0.20.1 \
--netmask 255.255.252.0 \
--netname iband \
--type infiniband \
n001
Node Discovery
--------------

View File

@@ -71,3 +71,114 @@ Here is an example of how the cluster's address can be divided for a
* ``10.0.2.1 - 10.0.2.255``: Static node addresses
* ``10.0.3.1 - 10.0.3.255``: IPMI and/or out of band addresses for the
compute nodes
Multiple networks
=================
It is possible to configure several networks not just for the nodes but also for the management of ``dhcpd`` and ``tftp``.
There are two ways to achive this:
1. Add the networks to the templates of ``dhcpd`` and/or the ``dnsmasq`` template directly.
2. Add the networks to a dummy node and change the templates of ``dhcp`` and ``dnsmasq`` accordingly.
As the first solution is trivial only the second way is described in the following lines.
As first the first step, add the dummy node.
.. code-block:: shell
wwctl node add deliverynet
Now you will have to add the delivery networks to this node.
.. code-block:: shell
wwctl node set \
--ipaddr 10.0.20.250 \
--netmask 255.255.255.0 \
--netname deliver1 \
--nettagadd network=10.0.20.0,dynstart=10.10.20.10,dynend=10.10.20.50 \
deliverynet
wwctl node set \
--ipaddr 10.0.30.250 \
--netmask 255.255.255.0 \
--netname deliver2 \
--nettagadd network=10.0.30.0,dynstart=10.10.30.10,dynend=10.10.30.50 \
deliverynet
The ip address is used as the network address of host in the delivery network and an additional tags is used for definition of the network itself and the dynamic dhcp range.
You can check the result with ``wwctl node list``.
.. code-block:: console
# wwctl node list -a deliverynet
NODE FIELD PROFILE VALUE
deliverynet Id -- deliverynet
deliverynet Comment default This profile is automatically included for each node
deliverynet ContainerName default leap15.5
deliverynet Ipxe -- (default)
deliverynet RuntimeOverlay -- (generic)
deliverynet SystemOverlay -- (wwinit)
deliverynet Root -- (initramfs)
deliverynet Init -- (/sbin/init)
deliverynet Kernel.Args -- (quiet crashkernel=no vga=791 net.naming-scheme=v238)
deliverynet Profiles -- default
deliverynet PrimaryNetDev -- (deliver1)
deliverynet NetDevs[deliver2].Type -- (ethernet)
deliverynet NetDevs[deliver2].OnBoot -- (true)
deliverynet NetDevs[deliver2].Ipaddr -- 10.0.30.250
deliverynet NetDevs[deliver2].Netmask -- 255.255.255.0
deliverynet NetDevs[deliver2].Tags[dynend] -- 10.10.30.50
deliverynet NetDevs[deliver2].Tags[dynstart] -- 10.10.30.10
deliverynet NetDevs[deliver2].Tags[network] -- 10.0.30.0
deliverynet NetDevs[deliver1].Type -- (ethernet)
deliverynet NetDevs[deliver1].OnBoot -- (true)
deliverynet NetDevs[deliver1].Ipaddr -- 10.0.20.250
deliverynet NetDevs[deliver1].Netmask -- 255.255.255.0
deliverynet NetDevs[deliver1].Primary -- (true)
deliverynet NetDevs[deliver1].Tags[network] -- 10.0.20.0
deliverynet NetDevs[deliver1].Tags[dynend] -- 10.10.20.50
deliverynet NetDevs[deliver1].Tags[dynstart] -- 10.10.20.10
Now the templates of ``dhcpd`` and/or ``dnsmasq`` must be modified.
You can edit the configuration files.
.. code-block:: shell
wwctl overlay edit host etc/dhcpd.conf.ww
wwctl overlay edit host etc/dnsmasq.d/ww4-hosts.ww
For the ``dhcp`` template you should add following lines
.. code-block::
{{/* multiple networks */}}
{{- range $node := $.AllNodes}}
{{- if eq $node.Id.Get "deliverynet" }}
{{- range $netname, $netdev := $node.NetDevs}}
# network {{ $netname }}
subnet {{$netdev.Tags.network.Get}} netmask {{$netdev.Netmask.Get}} {
max-lease-time 120;
range {{$netdev.Tags.dynstart.Get}} {{$netdev.Tags.dynend.Get}};
next-server {{$netdev.Ipaddr.Get}};
}
{{- end }}
{{- end }}
{{- end }}
and for the ``dnsmasq`` the following lines should be added
.. code-block::
{{/* multiple networks */}}
{{- range $node := $.AllNodes}}
{{- if eq $node.Id.Get "deliverynet" }}
{{- range $netname, $netdev := $node.NetDevs}}
# network {{ $netname }}
dhcp-range={{$netdev.Tags.dynstart.Get}},{{$netdev.Tags.dynend.Get}},{{$netdev.Netmask.Get}},6h
{{- end }}
{{- end }}
{{- end }}
Note that the ``{{- if eq $node.Id.Get "deliverynet" }}`` is used to identify the dummy host which carries the network information.