From 095d81c113651e0dbe39f2b49341cc02930cfa8d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Jan 2020 23:13:08 +0100 Subject: [PATCH] roulette --- mac_ip.py | 4 +++- roulette.nft | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mac_ip.py b/mac_ip.py index 82d1ed4..fa89855 100644 --- a/mac_ip.py +++ b/mac_ip.py @@ -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, diff --git a/roulette.nft b/roulette.nft index 6a4ef6e..97e85d0 100644 --- a/roulette.nft +++ b/roulette.nft @@ -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 } }