USB Network Adapters
We have recently acquired 170 laptops that do not have built in wired network ports so we have purchased a batch of 30 USB network adapters. The issue we have is that as the laptops are identified by the network adapters MAC address when one laptop is registered if we reuse a USB network adapter on another laptop it comes up as already registered with the original laptops hostname, so we then have to identify which USB adapter is being used and manually change the hostname on the fog server to the new hostname and then deploy the image (meaning we would only be able to add 30 hosts rather than the full 170). Is there a way to identify different hosts other than by using the network adapters MAC address?
My solution for this problem has been to use the api the remove usb macs when my provisioning script is done. I have it working by using the client.
The basics are
- Computer gets registered with usb adapter
- My custom provisioning starts and the fog service is started which will add pending macs
- I leave the usb adapter plugged in until my provisioning is complete (so software install and whatnot happens over ethernet not wifi)
- Last step of provisioning uses a powershell api function to remove any existing usb macs (I have a saved list in the powershell of macs in my code)
- Adapter can then be removed and used on the next device
My custom functions uses my published fogapi powershell module, particularly this function https://fogapi.readthedocs.io/en/latest/commands/Remove-UsbMac/
Here’s a link to the code on github https://github.com/darksidemilk/FogApi/blob/master/FogApi/Public/Remove-UsbMac.ps1
The function also handles making a new mac the client found be the primary mac if the usb mac is the current primary.
If you’re not using the client, you could also create a custom automation to find the mac addresses of the machine during a postscript/firstlogon/provisioning step and have it use https://github.com/darksidemilk/FogApi/blob/master/FogApi/Public/Add-FogHostMac.ps1 to add a new unique mac then use the remove-usbmac function to remove specified usb macs.
If you’d like more info or examples I’d be happy to help, just wanted to offer a quick overview of a possible solution.
@richard-wise if you go the route of using an external csv file, might i suggest putting it in the /images/postdownloadscripts directory of the fog server? it’s a location that will be mounted anyway
Just deploy and go, I don’t use the fog client.
OK good. So how do you name your systems? Is it something that can be calculated or prompted for during imaging?
In our case we use the load and go method, where the system name is calculated based on the install site and asset tag of the computer. We don’t use the fog client either. There is no need to register, we just pxe boot and pick deploy image. The post install script does everything to make the target system unique and update the unattend file. It sounds similar to what you do. We don’t worry about usb adapters or having the same mac address because that info is never stored.
@george1421 Just deploy and go, I don’t use the fog client.
@richard-wise Do you use the FOG server to manage the target computers post deployment or do you just load and go with imaging?
I have been having a think about this. I use a postdownload script to update the unattend file with the computername. Could I add the USB Network adapters as nonspecific hosts in fog and add them to a group, then in this postdownload script add a section that see’s if the host is in this specific group and if it is then look at the system serial number from the BIOS (DMI) then using if or case find the serial number in a list and return the corresponding hostname, which can then be updated in the unattend file. If so would I need to add all 170 laptops info in to the actual postdownload script or can the script be set to look at an external csv file?
Is there a way to identify different hosts other than by using the network adapters MAC address?
The short answer is no. Now the longer answer: This has been discussed a couple of times over the years but we never got to a final working solution. If you are keen you can work on this part of FOG.
The other possible solution is that some device firmware allows for an internal MAC address (e.g. from the wireless adapter) to be seen instead of the USB network adapter MAC address.