I am trying to set up the VMware DCHP server to push a static route (192.168.248.0/24 -> 192.168.248.129) to DHCP clients (VMs) connected to a custom interface called vmnet14
. I referred to this document: https://fishilico.github.io/generic-config/etc-server/dhcp/dhcpd.conf.raw.html.
Config file is like this:
allow unknown-clients;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
option rfc3442-classless-static-routes code 121 = array of integer 8;
subnet 192.168.248.128 netmask 255.255.255.224 {
range 192.168.248.138 192.168.248.157;
option broadcast-address 192.168.248.159;
option domain-name-servers 192.168.248.129;
option domain-name localdomain;
option routers 192.168.248.129;
option static-routes 192.168.248.0 192.168.248.129;
option rfc3442-classless-static-routes 24, 192, 168, 248, 192, 168, 248, 225;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
}
host vmnet14 {
hardware ethernet XX:XX:XX:XX:XX:XX;
fixed-address 192.168.248.129;
option domain-name-servers 0.0.0.0;
option domain-name "";
option routers 0.0.0.0;
}
Then vmware-networks-server
can no longer start.
Then I tried to debug by running:
sudo /usr/bin/vmnet-dhcpd \
-cf /etc/vmware/vmnet14/dhcpd/dhcpd.conf \
-lf /etc/vmware/vmnet14/dhcpd/dhcpd.leases \
-pf /var/run/vmnet-dhcpd-vmnet14.pid \
-f -d vmnet14
And I got:
Internet Software Consortium DHCP Server 2.0
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.
Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html
/etc/vmware/vmnet14/dhcpd/dhcpd.conf line 26: no option named rfc3442-classless-static-routes
option rfc3442-classless-static-routes code
^
/etc/vmware/vmnet14/dhcpd/dhcpd.conf line 36: no option named rfc3442-classless-static-routes
option rfc3442-classless-static-routes 24,
^
Configuration file errors encountered -- exiting
exiting.
This post: Static route set from dhcp was close, but the answer only says "I have used it and it worked" but did not provide an example. The link it has also does not have an example like where to add those options.