OpenWrt Forum Archive

Topic: Problem in Client ID String

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi there im triing since ages to get my Client ID like shown below:

"AVM dhcpdiscover 1.0 dslforum.org"

this string is requierd for my ISP

but unfortunately udhcpc always just takes the first word:

Frame 172: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: ZyxelCom_30:0e:54 (00:23:f8:30:0e:54), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68 (68), Dst Port: 67 (67)
Bootstrap Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x9049d06e
    Seconds elapsed: 30
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: ZyxelCom_30:0e:54 (00:23:f8:30:0e:54)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
    Option: (57) Maximum DHCP Message Size
    Option: (55) Parameter Request List
    Option: (60) Vendor class identifier
        Length: 3
        Vendor class identifier: AVM
    Option: (255) End
        Option End: 255
    Padding: 000000000000000000000000000000000000000000000000...

i tried with '' quotes with "" quotes without luck...

does anyone know how i can get a string with 'spaces' in there?

thanks in advance for your help

i already tried the idea below:

https://dev.openwrt.org/attachment/tick … p.sh.patch

%20 or +?

Unique Client ID (option 61) or Vendor class (option 60)????

You write about "client id", but your example shows Vendor class as AVM, so I guess you are actually talking about the Vendor class option...

If so, you might try this recent patch for /lib/netifd/proto/dhcp.sh that patched LEDE master to accept vendor IDs with spaces:
https://github.com/lede-project/source/ … 2854d54012

--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -56,8 +56,8 @@ proto_dhcp_setup() {
         -s /lib/netifd/dhcp.script \
         -f -t 0 -i "$iface" \
         ${ipaddr:+-r $ipaddr} \
-        ${hostname:+-H $hostname} \
-        ${vendorid:+-V $vendorid} \
+        ${hostname:+-H "$hostname"} \
+        ${vendorid:+-V "$vendorid"} \
         $clientid $broadcast $release $dhcpopts
 }

(Last edited by hnyman on 19 Aug 2016, 08:38)

i ment vendor class id, option 60

Bootstrap Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0xacb47309
    Seconds elapsed: 45
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: ZyxelCom_30:0e:54 (00:23:f8:30:0e:54)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
        Length: 1
        DHCP: Discover (1)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 576
    Option: (55) Parameter Request List
        Length: 7
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (12) Host Name
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (28) Broadcast Address
        Parameter Request List Item: (42) Network Time Protocol Servers
    Option: (60) Vendor class identifier
        Length: 33
        Vendor class identifier: AVM dhcpdiscover 1.0 dslforum.org

    Option: (255) End
        Option End: 255
    Padding: 0000000000000000


there we go! smile thanks for the hint

solution was:
+        ${hostname:+-H "$hostname"} \
+        ${vendorid:+-V "$vendorid"} \

in the  /lib/netifd/proto/dhcp.sh

(Last edited by maxias on 19 Aug 2016, 08:58)

The discussion might have continued from here.