TL;DR: I want to verify the following is the right procedure for using DHCP on a network bridge, where DHCP is actually used to assign TrueNAS a static IP address (via MAC address to IP mapping in the DHCP config).
Having recently discovered Jailmaker, I wanted to experiment with nspawn jails that can get their own IP via DHCP and be fully routeable on my network. The first step in doing this is to have a bridge interface on the TrueNAS host.
I’m not currently using VLANs. The TrueNAS system has a single physical network interface. I have my router set as a DHCP server, though most devices on the network (including the TrueNAS server) have a static MAC address to IP mapping. (IOW, the router’s DHCP config allows for a single point to manage static IP addresses and DNS names on my local network.)
Prior setting up the bridge, this was a trivial network config (enable DHCP on the one connected interface, and everything just works). After some trial and error, the process to switch to a bridge with static-DHCP appears to look like this:
- Router: disable the DHCP static mapping for the TrueNAS NIC’s MAC address
- TrueNAS: disable DHCP for the existing interface
- TrueNAS: create the bridge device, select DHCP, add the device from previous step as a member
- TrueNAS: save and test config
- Router: watch the DHCP log for a new request and make note of the MAC address
- At this point, on first glance, it will appear that the TrueNAS device has lost connectivity, but it should be alive and well but under a new DHCP address (this will be a temporary IP address)
- TrueNAS: login to the GUI using this new (temporary) IP and save the network config so that it is persistent
- Router: recreate the DHCP static mapping for TrueNAS but use the MAC address from step 5
- TrueNAS: restart networking (or reboot), and it should now be using the desired IP address
I also have a Proxmox server, which also has a single physical interface, no VLANs, and a bridge device. However, with that server, I am able to use the MAC address of the physical NIC for its DHCP static mapping. I initially assumed TrueNAS would work similarly, and struggled a bit until I realized that under TrueNAS, the bridge will make its DHCP query with a new MAC address.
Everything appears to be working. But my main question is: the MAC address that TrueNAS generated (step 5 above): can I count on that being permanent? Or is there a chance it will arbitrarily change?
Assuming its permanent, and the process I outlined above is indeed valid for this use case, I hope it’s useful for others who might be struggling.