[Kea-users] How to define "code width" / "length width" on Vendor-Specific Information option (code 43)

Kotetsu kakko kakkotetsu at gmail.com
Fri Apr 23 07:02:29 UTC 2021


Hi!
I want to convert isc-dhcp-server config below to Kea.
```
option space test_opt code width 2 length width 2 hash size 17;
option test_opt.script-url code 36 = text;

subnet 10.138.127.128 netmask 255.255.255.128 {
  option routers 10.138.127.129;
  option subnet-mask 255.255.255.128;
  range dynamic-bootp 10.138.127.220 10.138.127.254;
  vendor-option-space test_opt;
  option test_opt.script-url = "http://10.138.124.42/ztp_arcos.py";
}
```


I set up Kea like below.(extract)
```
"Dhcp4": {
    "option-def": [
        {
            "name": "test_opt_script-url",
            "code": 36,
            "space": "vendor-encapsulated-options-space",
            "type": "string"
        }
    ],

    "subnet4": [

        {
            "subnet": "10.138.127.128/25",
            "pools": [ { "pool": "10.138.127.220 - 10.138.127.254" } ],
            "option-data": [
                {
                    "name": "routers",
                    "data": "10.138.127.129"
                },
                {
                    "name": "test_opt_script-url",
                    "space": "vendor-encapsulated-options-space",
                    "data": "http://10.138.124.42/ztp_arcos.py"
                },
                {
                    "name": "vendor-encapsulated-options"
                }
            ]
        }
    ]
```

Kea's DHCP reply is below. It include option 43 field.

```
14:39:03.677003 IP (tos 0x0, ttl 64, id 16054, offset 0, flags [DF],
proto UDP (17), length 409)
    dhcpserver.bootps > 10.138.127.131.bootps: [bad udp cksum 0x1258
-> 0x5de2!] BOOTP/DHCP, Reply, length 381, hops 1, xid 0xd991b36f,
Flags [none] (0x0000)
          Your-IP 10.138.127.249
          Gateway-IP 10.138.127.131
          Client-Ethernet-Address b4:a9:fc:d7:7f:44 (oui Unknown)
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Offer
            Subnet-Mask Option 1, length 4: 255.255.255.128
            Default-Gateway Option 3, length 4: 10.138.127.129
            Domain-Name-Server Option 6, length 8: 10.138.124.36,10.138.124.37
            Hostname Option 12, length 9: "localhost"
            Domain-Name Option 15, length 14: "local"
            Vendor-Option Option 43, length 35:
36.33.104.116.116.112.58.47.47.49.48.46.49.51.56.46.49.50.52.46.52.50.47.122.116.112.95.97.114.99.111.115.46.112.121
            Lease-Time Option 51, length 4: 3600
            Server-ID Option 54, length 4: dhcpserver
            RN Option 58, length 4: 900
            RB Option 59, length 4: 1800
            Client-ID Option 61, length 7: ether b4:a9:fc:d7:7f:44
            T119 Option 119, length 16: 57370161,41185796,1768516201,40529920
            END Option 255, length 0
```

It looks `36(code).33(Length).(data)` but DHCP client expects
`00.36(code).00.33(length).(data)`

```
Vendor-Option Option 43, length 35:
36.33.104.116.116.112.58.47.47.49.48.46.49.51.56.46.49.50.52.46.52.50.47.122.116.112.95.97.114.99.111.115.46.112.121
```

How to reply `00.36(code).00.33(length).(data)` format?


Regards.

--
kakkotetsu (kakkotetsu at gmail.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20210423/515d6f9c/attachment.htm>


More information about the Kea-users mailing list