diff --git a/lib/socket.h b/lib/socket.h
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -123,6 +123,7 @@ extern int sk_priority_control;		/* Suggested priority for control traffic, shou
 #define SKF_TTL_RX	0x08	/* Report TTL / Hop Limit for RX packets */
 #define SKF_BIND	0x10	/* Bind datagram socket to given source address */
 #define SKF_HIGH_PORT	0x20	/* Choose port from high range if possible */
+#define SKF_BIND_NLOC	0x40	/* Use nonlocal bind option for the socket */
 
 #define SKF_THREAD	0x100	/* Socked used in thread, Do not add to main loop */
 #define SKF_TRUNCATED	0x200	/* Received packet was truncated, set by IO layer */
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -1328,6 +1328,7 @@ sk_open(sock *s)
   int bind_port = 0;
   ip_addr bind_addr = IPA_NONE;
   sockaddr sa;
+  int y = 1;
 
   if (s->type <= SK_IP)
   {
@@ -1436,6 +1437,16 @@ sk_open(sock *s)
 	if (sk_set_high_port(s) < 0)
 	  log(L_WARN "Socket error: %s%#m", s->err);
 
+    if (s->flags & SKF_BIND_NLOC)
+    {
+#ifdef IP_FREEBIND
+      if (setsockopt(s->fd, SOL_IP, IP_FREEBIND, &y, sizeof(y)) < 0)
+        ERR("IP_FREEBIND");
+#else
+      ERR("nonlocal bind is not supported");
+#endif
+    }
+
     sockaddr_fill(&sa, s->af, bind_addr, s->iface, bind_port);
     if (bind(fd, &sa.sa, SA_LEN(sa)) < 0)
       ERR2("bind");
