<p>A way to get around this without rooting the phone is to send your packets via multicast UDP*.  These packets will make it from GO1 to GO2.  </p>

<p>There are some side effects to this:  </p>

<ul>
<li><p>To use this for networking you must perform encapsulation and routing at the OSI Application level (not efficient).   </p></li>
<li><p>You will also need to route based on MAC addresses since every device has the same 192.168.49.1 address.</p></li>
<li><p>"It is important to note that the multicast socket encapsulates a one-to-many unicast communication and, as a result of this, cannot fully utilize the total available WiFi and WiFi Direct bandwidth" *</p></li>
</ul>

<p>Something else worth noting:  </p>

<ul>
<li>As you scale up the number of GOs, you will run into a problem of all nodes operating on the same wifi channel.  This isn't a problem with a few devices, but with hundreds of devices, it will be a huge problem.</li>
</ul>

<p>*This method was mentioned in Colin Funai, Cristiano Tapparello, and Wendi Heinzelman paper titled "Supporting Multi-hop Device-to-Device Networks Through WiFi Direct Multi-group Networking" found here: <a href="https://arxiv.org/pdf/1601.00028.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1601.00028.pdf</a></p>
Change WiFi-Direct IP range? Force IPv6 in Android WiFi-Direct?
<p>I have two Android KitKat phones, both are running WiFi-Direct groups as Group Owners, let's call them GO1 and GO2</p>

<p>I managed to connect GO1 as a legacy client to GO2 without breaking any of the (previously set) wifi-direct groups.</p>

<p>The problem is that, as you might know, the GO IP address is hardcoded in Android source, and is set to 192.168.49.1</p>

<p>Therefore, both of my devices, GO1 and GO2 have the same IP address (**)... each on his local network.</p>

<p>My app is both client and server at the same time. But both networks are using the same IP range (192.168.49.XXX), which, apparently, I cannot change.</p>

<p>As a result I cannot create a TCP connection between them if they are both hosting a WiFi-Direct Group, since any device will connect to itself when trying to connect to 192.168.49.1</p>

<p>So the questions are:</p>

<ul>
<li>Is there a way to change the IP range used in Wifi-Direct?</li>
<li>Is there a way to use IPv6 instead of IPv4 in Wifi-Direct?</li>
<li>Can any of this be done without rooting the phone?</li>
<li>Any other suggestion?</li>
</ul>

<p>** : Actually, because GO1 is connecting as a legacy client to GO2, then GO1 is known as 192.168.49.227 (for example) to GO2 and GO2 is known as 192.168.49.1 to GO1. But because GO1 is ALSO a GO, it also known as 192.168.49.1 to his clients (and itself).</p>