From c6cb06857960a392d927fa7fab2ae9ef6b0bd7a2 Mon Sep 17 00:00:00 2001 From: Romain Gehrig Date: Wed, 9 Mar 2022 15:29:20 +0100 Subject: [PATCH] Fix Docker instruction when host IP has more than 1 digit Instead of replacing the last char with `1`: replace everything starting from the last dot with `.1`. For instance, my Docker assigned the IP `172.30.0.14` to the interface which resulted to the wrong gateway IP `172.30.0.11` --- docs/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index c91299e10..ad36fc2c8 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -141,7 +141,7 @@ option. import os # only if you haven't already imported this import socket # only if you haven't already imported this hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) - INTERNAL_IPS = [ip[:-1] + '1' for ip in ips] + ['127.0.0.1', '10.0.2.2'] + INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + ["127.0.0.1", "10.0.2.2"] Troubleshooting ---------------