公式ドキュメントによると:
しかし、それは私にはまだ明らかではなく、dns66 のソースと Netguard のソースを掘り下げてもあまり役に立ちませんでした。
サーバーアドレスであると思われるかどうかはわかりませんが、他に意味のあるものは思いつきません。localVPN を実装する前に、どのアドレスを設定すればよいestablish()
ですか?
これは dns66 のソースですが、これらのアドレスを追加する理由がわかりません (すべてが「失敗」した場合、192.168.50.1 が機能することをどのように認識しますか?):
// Determine a prefix we can use. These are all reserved prefixes for example
// use, so it's possible they might be blocked.
for (String prefix : new String[]{"192.0.2", "198.51.100", "203.0.113"}) {
try {
builder.addAddress(prefix + ".1", 24);
} catch (IllegalArgumentException e) {
continue;
}
format = prefix + ".%d";
break;
}
// For fancy reasons, this is the 2001:db8::/120 subnet of the /32 subnet reserved for
// documentation purposes. We should do this differently. Anyone have a free /120 subnet
// for us to use?
byte[] ipv6Template = new byte[]{32, 1, 13, (byte) (184 & 0xFF), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
if (hasIpV6Servers(config, dnsServers)) {
try {
InetAddress addr = Inet6Address.getByAddress(ipv6Template);
Log.d(TAG, "configure: Adding IPv6 address" + addr);
builder.addAddress(addr, 120);
} catch (Exception e) {
e.printStackTrace();
ipv6Template = null;
}
} else {
ipv6Template = null;
}
if (format == null) {
Log.w(TAG, "configure: Could not find a prefix to use, directly using DNS servers");
builder.addAddress("192.168.50.1", 24);
}