Table of Contents

Hostid

Basics

Hostid is generated based on the ip address

192(0xc0).168(0xa8).100(0x64).101(0x65) = a8c06564
192(0xc0).168(0xa8).1(0x1).101(0x65)    = a8c0651

Change

id="12345678"
pa=${id:6:2}
pb=${id:4:2}
pc=${id:2:2}
pd=${id:0:2}
echo -ne \\x$pa\\x$pb\\x$pc\\x$pd > /etc/hostid
echo -ne \\x$pa\\x$pb\\x$pc\\x$pd | sudo tee /etc/hostid