[SOLVED] DHCP client options not sent

Started by mroy, March 04, 2021, 01:12:42 PM

Previous topic - Next topic
March 04, 2021, 01:12:42 PM Last Edit: March 04, 2021, 08:27:23 PM by mroy
Hello !

I'm trying to use OPNsense 21.1 to replace my ISP gateway, but I have an issue :
OPNsense DHCP client does not send the options 60 (dhcp-class-identifier) and 77 (user-class).

DHCP client configuration :
root@Gateway:~ # cat /var/etc/dhclient_wan.conf
interface "re1" {
# DHCP Protocol Timing Values

# DHCP Protocol Options
send dhcp-class-identifier "sagem";
send user-class "+FSVDSL_livebox.Internet.softathome.Livebox3";
send option-90 00:00:00:00:00:00:00:00:00:00:00:1a:09:00:00:05:58:01:03:41:01:0d:66:74:69:2f:xx:xx:xx:xx:xx:xx:xx;
request subnet-mask,broadcast-address,dhcp-lease-time,dhcp-renewal-time,dhcp-rebinding-time,domain-search,routers,domain-name-servers;

script "/usr/local/opnsense/scripts/interfaces/dhclient-script";
supersede interface-mtu 0;
}


Packet capture :
root@Gateway:~ # tcpdump -i re1 -nvvv udp port 67 or udp port 68
tcpdump: listening on re1, link-type EN10MB (Ethernet), capture size 262144 bytes
12:10:03.216569 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 335)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:1e:06:xx:xx:xx, length 307, xid 0xf0448f3d, secs 58, Flags [none] (0x0000)
  Client-Ethernet-Address 00:1e:06:xx:xx:xx
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    Client-ID Option 61, length 7: ether 00:1e:06:xx:xx:xx
    Hostname Option 12, length 7: "Gateway"
    Parameter-Request Option 55, length 8:
      Subnet-Mask, BR, Lease-Time, RN
      RB, Option 119, Default-Gateway, Domain-Name-Server
    AUTH Option 90, length 33: 0.0.0.0.0.0.0.0.0.0.0.26.9.0.0.5.88.1.3.65.1.13.x.x.x.x.x.x.x.x.x.x.x
    END Option 255, length 0


DHCP client :
root@Gateway:~ # dhclient -c /var/etc/dhclient_wan.conf re1
/var/etc/dhclient_wan.conf line 5: expecting string.
send dhcp-class-identifier �
                            ^
/var/etc/dhclient_wan.conf line 6: expecting string.
send user-class �
                 ^
dhclient 65974 - - Starting delete_old_states()
DHCPDISCOVER on re1 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on re1 to 255.255.255.255 port 67 interval 14


It looks like the DHCP client does not recognize these options.

Do you know how to resolve the issue ?

Thank you ! Have a nice day !

Alright, I answer to myself, I found the solution ::)

I used the configuration parameters found in the documentation here :
https://docs.opnsense.org/manual/how-tos/orange_fr_fttp.html

And unfortunately, the "quotation marks" were the wrong ones.
I changed "sagem" to "sagem", and changed "+FSVDSL_livebox.Internet.softathome.Livebox3" to "+FSVDSL_livebox.Internet.softathome.Livebox3".

Now it's working great in IPv4 and IPv6  ;)
Now I start my OPNsense journey.

DHCP client configuration :
root@Gateway:~ # cat /var/etc/dhclient_wan.conf
interface "re1" {
# DHCP Protocol Timing Values

# DHCP Protocol Options
send dhcp-class-identifier "sagem";
send user-class "+FSVDSL_livebox.Internet.softathome.Livebox3";
send option-90 00:00:00:00:00:00:00:00:00:00:00:1a:09:00:00:05:58:01:03:41:01:0d:66:74:69:2f:xx:xx:xx:xx:xx:xx:xx;
request subnet-mask,broadcast-address,dhcp-lease-time,dhcp-renewal-time,dhcp-rebinding-time,domain-search,routers,domain-name-servers;

script "/usr/local/opnsense/scripts/interfaces/dhclient-script";
supersede interface-mtu 0;
}


Packet capture :
root@Gateway:~ # tcpdump -i re1 -nvvv udp port 67 or udp port 68
tcpdump: listening on re1, link-type EN10MB (Ethernet), capture size 262144 bytes
18:06:00.834570 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 388)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:1e:06:xx:xx:xx, length 360, xid 0x413d434e, Flags [none] (0x0000)
  Client-Ethernet-Address 00:1e:06:xx:xx:xx
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    Vendor-Class Option 60, length 5: "sagem"
    Client-ID Option 61, length 7: ether 00:1e:06:xx:xx:xx
    Hostname Option 12, length 7: "Gateway"
    Parameter-Request Option 55, length 8:
      Subnet-Mask, BR, Lease-Time, RN
      RB, Option 119, Default-Gateway, Domain-Name-Server
    User-Class Option 77, length 44:
      instance#1: "FSVDSL_livebox.Internet.softathome.Livebox3", length 43
    AUTH Option 90, length 33: 0.0.0.0.0.0.0.0.0.0.0.26.9.0.0.5.88.1.3.65.x.x.x.x.x.x.x.x.x.x.x.x.x
    END Option 255, length 0


Sorry about that ;D
Have a nice evening !

Ha, those damned fancy quotation marks have caught me out before too!