Skip to content

Instantly share code, notes, and snippets.

@michelep
Last active June 18, 2020 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michelep/93f84f3b802010a02e5dfee776804ce9 to your computer and use it in GitHub Desktop.
Save michelep/93f84f3b802010a02e5dfee776804ce9 to your computer and use it in GitHub Desktop.
DHCP
...
# ===================== OPTION 66
# option tftp-server-name "tftp://voip.";
option tftp-server-name "voip.";
option subnet-mask 255.255.255.0;
# ==================== OPTION 114
# Gigaset URL for provisioning
option dhcp_114_FW_URL code 114 = text;
option dhcp_114_FW_URL "voip./provisioning.php";
# Cisco VLAN
option voip-tftp-server code 150 = { ip-address };
# Option 160
option prov-server code 160 = text;
# VLAN
option vlan-id code 132 = text;
default-lease-time 14400;
max-lease-time 28800;
ddns-update-style interim;
ddns-domainname "voip.";
update-conflict-detection on;
update-static-leases on;
class "phones_snom" {
match if (substring(hardware, 0, 4) = 01:00:04:13); # Telefoni SNOM
}
class "phones_snom_new" {
match if (binary-to-ascii(16, 8, ":", substring (hardware, 1, 3)) = "0:4:13"); # Telefoni SNOM
}
class "phones_cisco" {
match if (substring(hardware, 0, 4) = 01:cc:ef:48); # Telefoni Cisco
}
class "phones_cisco_new" {
match if (binary-to-ascii(16, 8, ":", substring (hardware, 1, 3)) = "cc:ef:48"); # Telefoni CISCO
}
class "phones_yealink" {
match if (substring(hardware, 0, 4) = 01:00:15:65); # Telefoni Yealink
}
class "phones_gigaset" {
match if (substring(hardware, 0, 4) = 01:7c:2f:80); # Cordless Gigaset
}
class "phones_gigaset_new" {
match if (binary-to-ascii(16, 8, ":", substring (hardware, 1, 3)) = "7c:2f:80"); # Telefoni GIGASET
}
class "ata_cisco" { # ATA SPA 112, 118, 8000
match if (
(substring(hardware, 0, 4) = 01:00:e1:6d) or
(substring(hardware, 0, 4) = 01:c4:72:95) or
(substring(hardware, 0, 4) = 01:bc:67:1c) or
(substring(hardware, 0, 4) = 01:88:90:8d)
);
option tftp-server-name "193....";
}
#################################################################################
### DISPOSITIVI ESTERNI / ALTRO
#################################################################################
class "phones_extra" {
match pick-first-value (option dhcp-client-identifier, hardware);
}
subclass "phones_extra" 1:00:a0:ba:09:xx:xx; #
#########################################################
# xxx
#########################################################
subnet 193.xxxx netmask 255.255.255.0 {
pool {
range 193.xxxx 193.yyyy;
option subnet-mask 255.255.255.0;
allow members of "phones_snom";
allow members of "phones_cisco";
allow members of "phones_gigaset";
allow members of "phones_extra";
}
}
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment