Description

This article provides information on how to send a classless static route ( option 121 ) to a DHCP client.

Symptoms

How to send a classless static route ( option 121 ) to a DHCP client.

Solution

For example, the static route is 2.2.2.0/24 with the next hop IP address as 8.8.8.8 , which is to be sent in the DHCP  option 121 :

root@SRX210-5# show interfaces ge-0/0/0
unit 0 {
    family inet {
        address 192.168.1.1/24;
    }
}
root@SRX210-5# show security zones
security-zone trust {
    host-inbound-traffic {
        system-services {
            all;
        }
protocols {
    all;
}
}
interfaces {
    ge-0/0/0.0;
}
}
set system services dhcp router 192.168.1.1
set system services dhcp option 121 array ip-address 24.2.2.2
set system services dhcp option 121 array ip-address 8.8.8.8
set system services dhcp pool 192.168.1.0/24 address-range low 192.168.1.2
set system services dhcp pool 192.168.1.0/24 address-range high 192.168.1.254
set system services dhcp propagate-settings ge-0/0/0.0

root@SRX210-5#show system services dhcp
router {
    192.168.1.1;
}
option 121 array ip-address [ 24.2.2.2 8.8.8.8 ];
pool 192.168.1.0/24 {
     address-range low 192.168.1.2 high 192.168.1.254;
}
propagate-settings ge-0/0/0.0;
Note : the IP address that was first used in the array is the destination address. For example, '2.2.20/24' has to be entered in the array as '24.2.2.2'.

The next IP address is the next-hop, which is 8.8.8.8 :
root@SRX210-5# run show system services dhcp global
Global settings:
BOOTP lease length infinite

DHCP lease times:
Default lease time 1 day
Minimum lease time 1 minute
Maximum lease time infinite

DHCP options:
Name: name-server, Value: [ 208.67.222.222, 208.67.220.220 ]
Name: router, Value: [ 192.168.1.1 ]
Code: 121, Type: ip-address, Value: [ 24.2.2.2, 8.8.8.8 ]
Refer to the following images:

alt

alt

Modification History

2024-09-02: minor non tech changes
2020-07-14: Archived