diff --git a/agent/commands/dhcp.py b/agent/commands/dhcp.py index f8890d1..48d669a 100644 --- a/agent/commands/dhcp.py +++ b/agent/commands/dhcp.py @@ -17,6 +17,8 @@ def dhcp_commit(client_ip: str, client_mac: str, switch_mac: str, switch_port: i abon = Abon.objects.get(device=dev, is_active=True) if not abon.is_dynamic_ip: return 'User settings is not dynamic' + if client_ip == abon.ip_address: + return 'Ip has already attached' abon.attach_ip_addr(client_ip, strict=False) if abon.is_access(): r = abon.nas_sync_self()