diff --git a/core/services/cable_guy/networksetup.py b/core/services/cable_guy/networksetup.py index 2524ceec3..0b72df827 100755 --- a/core/services/cable_guy/networksetup.py +++ b/core/services/cable_guy/networksetup.py @@ -80,9 +80,12 @@ def add_static_ip(self, interface_name: str, ip: str) -> None: data = settings.get_profile() if data.connection.interface_name != interface_name: continue - if any(ip in addressData.address for addressData in data.ipv4.address_data): - logger.info(f"IP {ip} already exists for {interface_name}") - continue + + for address_data in data.ipv4.address_data: + if ip == address_data.address: + logger.info(f"IP {ip} already exists for {interface_name}") + return + new_ip = AddressData(address=ip, prefix=24) data.ipv4.address_data.append(new_ip) settings.update_profile(data)