diff --git a/slapos/format.py b/slapos/format.py
index caa969f5f5a348df11459dcd21ff256d9cd9fa8b..f12088750753f7b6feb5569bd091a5d0c2415502 100644
--- a/slapos/format.py
+++ b/slapos/format.py
@@ -844,7 +844,7 @@ class Interface(object):
 
   def addIPv4LocalAddress(self, addr=None):
     """Adds local IPv4 address in ipv4_local_network"""
-    netmask = '255.255.255.254' if sys.platform == 'cygwin' \
+    netmask = str(netaddr.IPNetwork(self.ipv4_local_network).netmask) if sys.platform == 'cygwin' \
              else '255.255.255.255'
     local_address_list = self.getIPv4LocalAddressList()
     if addr is None: