[dhcp][keepalived] Enables dhcp on adh and infra

certbot_on_virtu
_benjamin 2020-08-16 17:03:28 +02:00
parent 59026f8151
commit 2a191b0622
4 changed files with 30 additions and 4 deletions

View File

@ -16,7 +16,28 @@ dhcp:
domain_name: "adh-nat.crans.org"
domain_search: "adh-nat.crans.org"
options: []
lease_file: "/tmp/dhcp.list"
lease_file: "/tmp/adh-nat-dhcp.list"
- network: "185.230.78.0/24"
deny_unknown: True
vlan: "adh"
default_lease_time: "600"
max_lease_time: "7200"
routers: "185.230.78.99"
dns: ["185.230.78.99"]
domain_name: "adh.crans.org"
domain_search: "adh.crans.org"
options: []
lease_file: "/tmp/adh-dhcp.list"
- network: "172.16.32.0/22"
deny_unknown: True
vlan: "infra"
default_lease_time: "600"
max_lease_time: "7200"
dns: ["172.16.32.99"]
domain_name: "infra.crans.org"
domain_search: "infra.crans.org"
options: []
lease_file: "/tmp/infra-dhcp.list"
re2o:
server: re2o.adm.crans.org

View File

@ -11,6 +11,9 @@ glob_keepalived:
ipv6: no
notify: /usr/scripts/notify-dhcp
zones:
- vlan: adh
ipv4: 185.230.78.99/24
brd: true
- vlan: adh-nat
ipv4: 100.64.0.99/16
brd: true

View File

@ -45,7 +45,9 @@ subnet {{ subnet.network | ipaddr('network') }} netmask {{ subnet.network | ipad
{% endif %}
option subnet-mask {{ subnet.network | ipaddr('netmask') }};
option broadcast-address {{ subnet.network | ipaddr('broadcast') }};
{% if subnet.routers is defined %}
option routers {{ subnet.routers }};
{% endif %}
option domain-name-servers {{ subnet.dns | join(", ") }};
option domain-name "{{ subnet.domain_name }}";
option domain-search "{{ subnet.domain_search }}";

View File

@ -26,11 +26,11 @@ vrrp_instance {{ instance.tag }}4 {
virtual_ipaddress {
{% for zone in keepalived.pool[instance.name].zones %}
{% if zone.brd %}
{% if zone.brd %}
{{ zone.ipv4 }} brd {{ zone.ipv4 | ipaddr('broadcast') }} dev {{ interfaces[zone.vlan] }} scope global
{% else %}
{% else %}
{{ zone.ipv4 }} dev {{ interfaces[zone.vlan] }} scope global
{% endif %}
{% endif %}
{% endfor %}
}
}