fix dhcp router ip
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
1cdb89b0e6
commit
7c4e3a8e47
2 changed files with 4 additions and 2 deletions
|
|
@ -28,6 +28,8 @@ function int_to_mac() {
|
|||
function generate_dhcp_file {
|
||||
# CIDR de départ (ex: "10.10.10.0/24")
|
||||
cidr="${1}"
|
||||
gateway_cidr=${3}
|
||||
gateway="$(echo "${gateway_cidr}" | cut -d\/ -f1)"
|
||||
subnet="$(echo "${cidr}" | cut -d\/ -f1)"
|
||||
output_file="/etc/dnsmasq.d/${2}.conf"
|
||||
|
||||
|
|
@ -66,7 +68,7 @@ function generate_dhcp_file {
|
|||
|
||||
echo "no-resolv" >> "$output_file"
|
||||
echo "dhcp-range=${subnet},static,255.255.255.0,12h" >> "$output_file"
|
||||
echo "dhcp-option=3,240.0.2.1" >> "$output_file"
|
||||
echo "dhcp-option=3,${gateway}" >> "$output_file"
|
||||
echo "dhcp-option=6,1.1.1.1,8.8.8.8" >> "$output_file"
|
||||
|
||||
# Variables pour l'incrémentation des MAC et IP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue