[Dnsmasq-discuss] Infiniband IBoIP support

John Hanks griznog at gmail.com
Tue May 26 06:46:50 BST 2015


After some further googling around, I finally found some hints to this in
the Mellanox Flexboot guide, but to save someone else the same amount of
searching, I thought I'd summarize here.

The Client ID for the IB interfaces is made up of a prefix
(ff:00:00:00:00:00:02:00:00:02:c9:00) combined with the last 8 hex pairs
from the hardware address (/sys/class/net/ib0/address). A quick hack to
create dnsmasq dhcp-host entries from an IB host (assuming the IB
interfaces have already gotten an IP by some other means) is:

#!/bin/bash
HWADDR=$(</sys/class/net/ib0/address)
PREFIX=ff:00:00:00:00:00:02:00:00:02:c9:00
SUFFIX=$(echo $HWADDR | sed
's#..:..:..:..:..:..:..:..:..:..:..:..:\(..:..:..:..:..:..:..:..\)#\1#g')
MACADDR=$(echo $HWADDR | sed
's#..:..:..:..:..:..:..:..:..:..:..:..:\(..:..:..:\)..:..:\(..:..:..\)#\1\2#g')
IPADDR=$(ip -o addr show ib0 | grep " inet " | sed 's#.*inet
\([0-9\.]*\)/.*#\1#g')
HOSTNAME=$(hostname -s)
echo "$MACADDR,id:$PREFIX:$SUFFIX,$IPADDR,$HOSTNAME,1d"

Below is a rough offering for an additional entry about this in the
dnsmasq.conf.example file.

Thanks again for a great tool,

jbh

--- dnsmasq.conf.example.orig 2015-05-26 08:25:15.230230969 +0300
+++ dnsmasq.conf.example 2015-05-26 08:45:31.207683552 +0300
@@ -251,6 +251,13 @@
 # the IP address 192.168.0.60
 #dhcp-host=id:01:02:02:04,192.168.0.60

+# Always give the Infiniband interface with hardware address
+# 80:00:00:48:fe:80:00:00:00:00:00:00:f4:52:14:03:00:28:05:81 the
+# ip address 192.168.0.61. The client id is derived from the prefix
+# ff:00:00:00:00:00:02:00:00:02:c9:00 and the last 8 pairs of
+# hex digits of the hardware address.
+#dhcp-host=id:ff:00:00:00:00:00:02:00:00:02:c9:00:f4:52:14:03:00:28:05:81,192.168.0.61
+
 # Always give the host with client identifier "marjorie"
 # the IP address 192.168.0.60
 #dhcp-host=id:marjorie,192.168.0.60
@@ -645,4 +652,4 @@
 #conf-dir=/etc/dnsmasq.d,.bak

 # Include all files in a directory which end in .conf
-#conf-dir=/etc/dnsmasq.d/*.conf
\ No newline at end of file
+#conf-dir=/etc/dnsmasq.d/*.conf


On Mon, May 25, 2015 at 3:16 PM, John Hanks <griznog at gmail.com> wrote:

> Moshe,
>
> Thank you, that works perfectly.
>
> jbh
>
> On Mon, May 25, 2015 at 3:12 PM, Moshe Levi <moshele at mellanox.com> wrote:
>
>>  Hi John,
>>
>>
>>
>> The Infiniband dhcp is using client –id option as identifier so your host
>> file should be
>>
>>
>> 00:11:75:78:d6:7e,id:ff:00:00:00:00:00:02:00:00:02:c9:00:00:11:75:00:00:78:d6:7e
>> ,set:pxemenu,192.168.22.1,db711-02-1,1d
>>
>>
>>
>> Let me know if that helps.
>>
>>
>>
>> Thanks,
>>
>>                 Moshe Levi
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *From:* Dnsmasq-discuss [mailto:
>> dnsmasq-discuss-bounces at lists.thekelleys.org.uk] *On Behalf Of *John
>> Hanks
>> *Sent:* Monday, May 25, 2015 2:26 PM
>> *To:* dnsmasq-discuss at lists.thekelleys.org.uk
>> *Subject:* [Dnsmasq-discuss] Infiniband IBoIP support
>>
>>
>>
>> Hello,
>>
>>
>>
>> I'm trying to hand out addresses to my Infiniband adapters using dnsmasq,
>> but doing the naive configuration doesn't seem to work. In my
>> dhcp-hostsfile I have this entry:
>>
>>
>>
>>
>> ff:00:00:00:00:00:02:00:00:02:c9:00:00:11:75:00:00:78:d6:7e,set:pxemenu,192.168.22.1,db711-02-1,1d
>>
>>
>>
>> When I attempt to bring up the ib0 interface on this node, I see this in
>> the dnsmasq log:
>>
>>
>>
>> 717987360 available DHCP subnet: 192.168.16.0/255.255.240.0
>>
>> 717987360 DHCPDISCOVER(ib0)
>> ff:00:00:00:00:00:02:00:00:02:c9:00:00:11:75:00:00:78:d6:7e ignored
>>
>> 717987360 available DHCP subnet: 192.168.16.0/255.255.240.0
>>
>> 717987360 DHCPDISCOVER(ib0)
>> ff:00:00:00:00:00:02:00:00:02:c9:00:00:11:75:00:00:78:d6:7e ignored
>>
>>
>>
>> How do I get dnsmasq to hand out addresses to these requests? My
>> searching hasn't turned up much other than some rpms for a mellanox version
>> of dnsmasq, which I haven't yet tried as I am hoping to just use a vanilla
>> DNSmasq for this project.
>>
>>
>>
>> Thanks,
>>
>>
>>
>> jbh
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20150526/cf21018b/attachment.html>


More information about the Dnsmasq-discuss mailing list