This commit is contained in:
root 2020-01-22 23:13:08 +01:00
parent 4705ca5e7b
commit 095d81c113
2 changed files with 6 additions and 2 deletions

View file

@ -46,10 +46,12 @@ def gen_ip_mac_set():
"""
api_client = Re2oAPIClient(api_hostname, api_username, api_password)
hosts = api_client.list('dhcp/hostmacip')
for h in hosts:
print(h)
content = [
(h['ipv4'], h['mac_address'])
for h in hosts
if h['ipv4'] and h['mac_address']
if 'ipv4' in h and h['ipv4'] and h['mac_address']
]
return NetfilterSet(
target_content=content,

View file

@ -23,7 +23,9 @@ table inet firewall {
type ipv4_addr
elements = {
10.7.0.4,
92.242.132.24
92.242.132.24,
104.28.28.23,
104.28.29.23
}
}