Arbitrary dhcp options (Fios Verizon DHCP issues - WRT1200AC)

Short
My router would randomly get disconnected from my Verizon Fios drop and not renew DHCP. It appears that adding a "Client ID" under Interfaces / Wan / Advanced / Client ID, in hex like "73696d6f6e2773206c6170746f700a" for example will fix the issue..

($ echo "My Router" | xxd -g 100 | awk '{print $2}' to produce the above output)

Adding a Client ID will turn the DHCP message type into a DHCP Request. Without this option your router will only broadcast "DHCP Discovery" requests which Verizon appears to be ignoring, at least for me...

Long:

Before I realized the Client ID option was DHCP type 61, I ran a sniffer on a laptop that could pull dhcp directly from Verizon and on my router running LEDE and compared the difference. I was able to see that my router was doing just "DHCP discovery" while running "dhclient" directly from my laptop would produce DHCP Requests which would work.

After doing some research, I manually ran udhcpc using '-x 61' from the cli and was able to get a DHCP IP address from Verizon. To automate this, I added the following options remarked with "<-----" to /lib/netifd/proto/dhcp.sh

#!/bin/sh

. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"

proto_dhcp_init_config() {
        renew_handler=1

        proto_config_add_string 'ipaddr:ipaddr'
        proto_config_add_string 'hostname:hostname'
        proto_config_add_string clientid
        proto_config_add_string dhcphack <-----
        proto_config_add_string vendorid
        proto_config_add_boolean 'broadcast:bool'
        proto_config_add_boolean 'release:bool'
        proto_config_add_string 'reqopts:list(string)'
        proto_config_add_string iface6rd
        proto_config_add_string sendopts
        proto_config_add_boolean delegate
        proto_config_add_string zone6rd
        proto_config_add_string zone
        proto_config_add_string mtu6rd
        proto_config_add_string customroutes
        proto_config_add_boolean classlessroute

}

proto_dhcp_setup() {
        local config="$1"
        local iface="$2"

        local ipaddr hostname clientid dhcphack vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
        json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute

        local opt dhcpopts
        for opt in $reqopts; do
                append dhcpopts "-O $opt"
        done

        for opt in $sendopts; do
                append dhcpopts "-x $opt"
        done

        [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
        [ "$release" = 1 ] && release="-R" || release=
        [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
        [ -n "$dhcphack" ] && dhcphack="-x 61:7975726d756d0a" <-----
        [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
        [ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
        [ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
        [ -n "$zone" ] && proto_export "ZONE=$zone"
        [ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
        [ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
        [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
        # Request classless route option (see RFC 3442) by default
        [ "$classlessroute" = "0" ] || append dhcpopts "-O 121"

        proto_export "INTERFACE=$config"
        proto_run_command "$config" udhcpc \
                -p /var/run/udhcpc-$iface.pid \
                -s /lib/netifd/dhcp.script \
                -f -t 0 -i "$iface" \
                ${ipaddr:+-r $ipaddr} \
                ${hostname:+-x62: "hostname:$hostname"} \
                ${vendorid:+-V "$vendorid"} \
                $clientid $broadcast $release $dhcpopts $dhcphack <-----
}

proto_dhcp_renew() {
        local interface="$1"
        # SIGUSR1 forces udhcpc to renew its lease
        local sigusr1="$(kill -l SIGUSR1)"
        [ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1
}

proto_dhcp_teardown() {
        local interface="$1"
        proto_kill_command "$interface"
}

add_protocol dhcp

EOF

Conclusion

Doing either the short of the long version will force DHCP Request vs DHCP discovery ultimately fixing the issue I was having with Verizon. It would be cool to add the ability to sniff traffic from web interface the ability to specify arbitrary data for things like DHCP and possibly other connection types from the web interface. Hopefully this information will help someone else having the same problem I had.

TLDR Add 4d7920526f757465720a to the Client ID under Wan Interface / Advanced if Verizon stops issuing your router an IP address via DHCP.

This happens when you are connected from the ONT? Your with Verizon Fios not Frontier, correct? How long are you a customer and did this start recently?

This was actually a problem with the drop from my ONT that goes throughout my house. I fixed it by throwing away the crap Verizon device that was splitting the connection from the ONT and plugging the cat5 drop directly into my router. I haven't had any downtime since. Sorry for any confusion.

That is the only way to do it right, ONT, ethernet to your router. Nice you have it working properly...

1 Like

If you have FiOS TV, this may also be helpful to some if you want to bring-your-own-device: [Solved] Multicast IPTV "passthrough" Netgear R7800

FYI, I sniffed the original router, and my DHCP vendor class is:

FiOS-G1100:dslforum.org

But I do not recall a Client ID - and neither are needed to get or renew DHCP.

I do note that sometimes the carrier changes the subnet in which my device is in, but I simply am offline for the duration of the lease.