This article describes how to change the TTL (time to live, or hop limit) value in the DHCPDISCOVER packet (or in any broadcast packet) to help prevent interoperability issues.
The goal is to help prevent any interoperability issues by increasing the TTL value of the DHCPDISCOVER packet.
DHCPDISCOVER (or other broadcast packets) uses the variable net.inet.ip.mcast_ttl to set the value of TTL.
The variable is described as follows on a shell prompt through sysctl:
root@100-1% sysctl -d net.inet.ip.mcast_ttl net.inet.ip.mcast_ttl: Maximum multicast TTL on IP packets
By default, the value of the variable is 1:
root@100-1% sysctl net.inet.ip.mcast_ttl net.inet.ip.mcast_ttl: 1
The default TTL value in Discover packets from SRX is 1, as seen in this example packet capture.
When SRX acts as a DHCP client, it sends a DHCPDISCOVER packet with a TTL value of 1. This can cause interoperability issues with some devices (such as ProCurve, from HP), which, when acting as relays before sending requests to DHCP servers, decrease the TTL.
Changing the TTL Value in the DHCPDISCOVER packet
To change the TTL value, use the command below:
root@srx% sysctl -w net.inet.ip.mcast_ttl=2
Verify that the value was changed from 1 to 2 by using the command below:
Now, delete and reconfigure DHCP on the interface (if the interface is not configured, ignore this step):
delete interfaces fe-0/0/0.0 family inet dhcp commit set interfaces fe-0/0/0.0 family inet dhcp commit
Take a new packet capture. Note that in the DHCPDISCOVER packets seen in the example, the TTL is changed to 64. But, it is recommended that you do not change the TTL to more than 2-3 hops, unless required.
Note: These changes are not permanent and will be lost when the device is rebooted.
To have the device retain the changes after a reboot, edit the /etc/rc.custom file (from the shell prompt), and add the following content:
root@SRX% cat /etc/rc.custom #!/sbin/sh sysctl -w net.inet.ip.mcast_ttl=2 root@SRX% chmod 755 /cf/etc/rc.custom