diff --git a/dhcp_server/config.json b/dhcp_server/config.json index be09c16..8620dc0 100644 --- a/dhcp_server/config.json +++ b/dhcp_server/config.json @@ -20,7 +20,7 @@ "range_start": "192.168.1.100", "range_end": "192.168.1.200", "broadcast": "192.168.1.255", - "routers": ["192.168.1.1"] + "gateway": "192.168.1.1" } ], "hosts": [ @@ -37,7 +37,7 @@ "range_start": "str", "range_end": "str", "broadcast": "str", - "routers": ["str"] + "gateway": "str" } ], "hosts": [ diff --git a/dhcp_server/run.sh b/dhcp_server/run.sh index 93ec078..a33b162 100644 --- a/dhcp_server/run.sh +++ b/dhcp_server/run.sh @@ -18,12 +18,12 @@ for (( i=0; i < "$NETWORKS"; i++ )); do RANGE_START=$(jq --raw-output ".networks[$i].range_start" $CONFIG_PATH) RANGE_END=$(jq --raw-output ".networks[$i].range_end" $CONFIG_PATH) BROADCAST=$(jq --raw-output ".networks[$i].broadcast" $CONFIG_PATH) - ROUTERS=$(jq --raw-output ".networks[$i].routers | joint(\", \")" $CONFIG_PATH) + GATEWAY=$(jq --raw-output ".networks[$i].gateway" $CONFIG_PATH) { echo "subnet $SUBNET netmask $NETMASK {" echo " range $RANGE_START $RANGE_END;" - echo " option routers $ROUTERS;" + echo " option routers $GATEWAY;" echo " option broadcast-address $BROADCAST;" echo "}" } >> /etc/dhcpd.conf