now doing BCP38
parent
ac521117b0
commit
ec1905f1bd
@ -1,3 +1,27 @@
|
|||||||
create foo hash:net,iface family inet hashsize 1024 maxelem 65536
|
create tmp-bcp38-cone-oface-v4 hash:net,iface family inet hashsize 1024 maxelem 65536
|
||||||
add foo 0.0.0.0/0,eth0
|
{% for iface, iface_data in salt["pillar.get"]("interfaces").items() %}{% if iface_data.get("bcp38",None) %}{% set jsonblob = salt["cmd.run"]("/tmp/bgpq3 -A -4 -j " + iface_data["bcp38"]["source"]["bgpq3"]["IPv4"], env={"BIND_ADDR":pillar["loopback"]["IPv4"], "BIND_ADDR6":pillar["loopback"]["IPv6"], "LD_PRELOAD":"/tmp/bind.so"})|load_json %}{% for prefix in jsonblob.NN|groupby("prefix") %}
|
||||||
add foo 0.0.0.0/0,lo
|
add tmp-bcp38-cone-oface-v4 {{ prefix.grouper }},{{ iface }}
|
||||||
|
{% endfor %}{% endif %}{% endfor %}
|
||||||
|
swap tmp-bcp38-cone-oface-v4 bcp38-cone-oface-v4
|
||||||
|
destroy tmp-bcp38-cone-oface-v4
|
||||||
|
|
||||||
|
create tmp-bcp38-else-oface-v4 hash:net,iface family inet hashsize 1024 maxelem 65536
|
||||||
|
{% for iface, iface_data in salt["pillar.get"]("interfaces").items() %}{% if iface_data.get("bcp38",None) %}
|
||||||
|
add tmp-bcp38-else-oface-v4 0.0.0.0/0,{{ iface }}
|
||||||
|
{% endif %}{% endfor %}
|
||||||
|
swap tmp-bcp38-else-oface-v4 bcp38-else-oface-v4
|
||||||
|
destroy tmp-bcp38-else-oface-v4
|
||||||
|
|
||||||
|
create tmp-bcp38-cone-oface-v6 hash:net,iface family inet6 hashsize 1024 maxelem 65536
|
||||||
|
{% for iface, iface_data in salt["pillar.get"]("interfaces").items() %}{% if iface_data.get("bcp38",None) %}{% set jsonblob = salt["cmd.run"]("/tmp/bgpq3 -A -6 -j " + iface_data["bcp38"]["source"]["bgpq3"]["IPv6"], env={"BIND_ADDR":pillar["loopback"]["IPv4"], "BIND_ADDR6":pillar["loopback"]["IPv6"], "LD_PRELOAD":"/tmp/bind.so"})|load_json %}{% for prefix in jsonblob.NN|groupby("prefix") %}
|
||||||
|
add tmp-bcp38-cone-oface-v6 {{ prefix.grouper }},{{ iface }}
|
||||||
|
{% endfor %}{% endif %}{% endfor %}
|
||||||
|
swap tmp-bcp38-cone-oface-v6 bcp38-cone-oface-v6
|
||||||
|
destroy tmp-bcp38-cone-oface-v6
|
||||||
|
|
||||||
|
create tmp-bcp38-else-oface-v6 hash:net,iface family inet6 hashsize 1024 maxelem 65536
|
||||||
|
{% for iface, iface_data in salt["pillar.get"]("interfaces").items() %}{% if iface_data.get("bcp38",None) %}
|
||||||
|
add tmp-bcp38-else-oface-v6 ::/0,{{ iface }}
|
||||||
|
{% endif %}{% endfor %}
|
||||||
|
swap tmp-bcp38-else-oface-v6 bcp38-else-oface-v6
|
||||||
|
destroy tmp-bcp38-else-oface-v6
|
||||||
|
Loading…
Reference in New Issue