isc-dhcp: allow suppression of default gateway
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
parent
5a0f41556f
commit
d2dd1bef71
1 changed files with 6 additions and 2 deletions
|
@ -364,7 +364,9 @@ gen_dhcp_subnet() {
|
||||||
echo " default-lease-time $leasetime;"
|
echo " default-lease-time $leasetime;"
|
||||||
echo " max-lease-time $leasetime;"
|
echo " max-lease-time $leasetime;"
|
||||||
fi
|
fi
|
||||||
echo " option routers $gateway;"
|
if [ "$defaultroute" -eq 1 ] ; then
|
||||||
|
echo " option routers $gateway;"
|
||||||
|
fi
|
||||||
echo " option domain-name-servers $DNS;"
|
echo " option domain-name-servers $DNS;"
|
||||||
config_list_foreach "$cfg" "routes" append_routes
|
config_list_foreach "$cfg" "routes" append_routes
|
||||||
config_list_foreach "$cfg" "dhcp_option" append_dhcp_options
|
config_list_foreach "$cfg" "dhcp_option" append_dhcp_options
|
||||||
|
@ -374,7 +376,7 @@ gen_dhcp_subnet() {
|
||||||
dhcpd_add() {
|
dhcpd_add() {
|
||||||
local cfg="$1" synthesize="$2"
|
local cfg="$1" synthesize="$2"
|
||||||
local dhcp6range="::"
|
local dhcp6range="::"
|
||||||
local dynamicdhcp end gateway ifname ignore leasetime limit net netmask
|
local dynamicdhcp defaultroute end gateway ifname ignore leasetime limit net netmask
|
||||||
local proto networkid start subnet
|
local proto networkid start subnet
|
||||||
local IP NETMASK BROADCAST NETWORK PREFIX DNS START END
|
local IP NETMASK BROADCAST NETWORK PREFIX DNS START END
|
||||||
|
|
||||||
|
@ -404,6 +406,8 @@ dhcpd_add() {
|
||||||
|
|
||||||
config_get_bool dynamicdhcp "$cfg" "dynamicdhcp" 1
|
config_get_bool dynamicdhcp "$cfg" "dynamicdhcp" 1
|
||||||
|
|
||||||
|
config_get_bool defaultroute "$cfg" "default_route" 1
|
||||||
|
|
||||||
dhcp_ifs="$dhcp_ifs $ifname"
|
dhcp_ifs="$dhcp_ifs $ifname"
|
||||||
|
|
||||||
eval "$(ipcalc.sh $subnet $start $limit)"
|
eval "$(ipcalc.sh $subnet $start $limit)"
|
||||||
|
|
Loading…
Reference in a new issue