{
    "componentChunkName": "component---src-templates-docs-js",
    "path": "/docker/handling-ip-conflicts-in-docker",
    "result": {"data":{"site":{"siteMetadata":{"title":"Linnaeus University","language":"en"}},"mdx":{"fields":{"id":"a970d707-8353-5dce-8814-2ef55f2f935a","title":"Handling IP Conflicts in Docker","slug":"/docker/handling-ip-conflicts-in-docker"},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Handling IP Conflicts in Docker\",\n  \"metaTitle\": \"Handling IP Conflicts in Docker\",\n  \"metaDescription\": \"Learn how to avoid IP conflicts between Docker and university campus networks.\",\n  \"order\": 1\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"This guide explains how to configure Docker to avoid conflicts with university campus networks and\\nVPNs (typically 172.x.x.x) by moving Docker's network pools to the 192.168 range.\"), mdx(\"h2\", null, \"Why is this necessary?\"), mdx(\"p\", null, \"Many university networks, campus firewalls, and internal resources use the 172.x.x.x range. If\\nDocker uses the same addresses, your computer won't be able to distinguish between a local\\ncontainer and a university server (such as a library database, lab resource, or internal tool).\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"This conflict occurs regardless of your connection method:\")), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"On-campus:\"), \" When connected to the university network via Ethernet or Eduroam.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Off-campus:\"), \" When connected via a VPN to access restricted university resources.\")), mdx(\"p\", null, \"Moving Docker to a safe IP range ensures seamless connectivity across different campuses and\\nremote locations.\"), mdx(\"h2\", null, \"1. IP Address Strategy\"), mdx(\"p\", null, \"To easily distinguish between environments during troubleshooting and avoid common home router\\nranges (like 192.168.1.x):\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Local (Docker Desktop):\"), \" Uses the higher range (\", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"128\"), \") to remain distinct from common public\\nWi-Fi and home setups.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Server/VPS (Docker Engine):\"), \" Uses the lower range (\", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"64\"), \"), which rarely conflicts with cloud\\nproviders' internal networks.\")), mdx(\"h2\", null, \"2. Configuration: Docker Desktop (Windows, Mac, or Linux GUI)\"), mdx(\"p\", null, \"If you are using the graphical interface of Docker Desktop:\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Open \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Settings\"), \" (gear icon).\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Navigate to \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Docker Engine\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Update the JSON configuration:\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-json\"\n  }, \"{\\n  \\\"bip\\\": \\\"192.168.128.1/24\\\",\\n  \\\"default-address-pools\\\": [\\n    {\\n      \\\"base\\\": \\\"192.168.129.0/18\\\",\\n      \\\"size\\\": 24\\n    }\\n  ]\\n}\\n\")), mdx(\"p\", null, mdx(\"em\", {\n    parentName: \"p\"\n  }, \"Click \", mdx(\"strong\", {\n    parentName: \"em\"\n  }, \"Apply & Restart\"), \" after making changes.\")), mdx(\"h2\", null, \"3. Configuration: Docker Engine (Native Linux Server)\"), mdx(\"p\", null, \"For native Linux installations (e.g., Ubuntu, Debian, RHEL), edit the daemon configuration file:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"sudo nano /etc/docker/daemon.json\\n\")), mdx(\"p\", null, \"Paste the following configuration:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-json\"\n  }, \"{\\n  \\\"bip\\\": \\\"192.168.64.1/24\\\",\\n  \\\"default-address-pools\\\": [\\n    {\\n      \\\"base\\\": \\\"192.168.65.0/18\\\",\\n      \\\"size\\\": 24\\n    }\\n  ]\\n}\\n\")), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Restart the Docker service to apply changes:\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"sudo systemctl restart docker\\n\")), mdx(\"h2\", null, \"4. Post-Setup and Migration\"), mdx(\"h3\", null, \"Verify New Settings\"), mdx(\"p\", null, \"Run this command to ensure the default bridge has changed its IP:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"docker network inspect bridge --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'\\n\")), mdx(\"h3\", null, \"Update Existing Projects (Migration)\"), mdx(\"p\", null, \"To force all projects to migrate to the new IP range immediately, run these commands:\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Stop all running containers:\")), mdx(\"pre\", {\n    parentName: \"li\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"docker stop \\\\$(docker ps -q)\\n\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Remove all old networks:\")), mdx(\"pre\", {\n    parentName: \"li\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"docker network prune -f\\n\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Restart your projects:\")), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Navigate to your project directory and start the containers using the appropriate Docker Compose\\ncommand for the project.\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Example:\"), mdx(\"pre\", {\n    parentName: \"li\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"docker compose up -d\\n\")))), mdx(\"h3\", null, \"Identify \\\"Legacy\\\" Networks\"), mdx(\"p\", null, \"To check if any networks are still residing in the old 172.x.x.x range:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-bash\"\n  }, \"docker network inspect \\\\$(docker network ls -q) --format '{{.Name}}: {{range .IPAM.Config}}{{.Subnet}}{{end}}'\\n\")), mdx(\"h2\", null, \"Why This Setup?\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Troubleshooting:\"), \" If you see an IP starting with 128, you know it's your local machine. If\\nyou see 64, it's the VPS.\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Safety:\"), \" 192.168.64+ avoids most common home routers (which typically use 192.168.0.x or\\n1.x).\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Universal Connectivity:\"), \" Ensures your Docker environment and university network can coexist,\\nwhether you are \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"on campus\"), \" or \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"working remotely\"), \" via VPN.\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#why-is-this-necessary","title":"Why is this necessary?"},{"url":"#1-ip-address-strategy","title":"1. IP Address Strategy"},{"url":"#2-configuration-docker-desktop-windows-mac-or-linux-gui","title":"2. Configuration: Docker Desktop (Windows, Mac, or Linux GUI)"},{"url":"#3-configuration-docker-engine-native-linux-server","title":"3. Configuration: Docker Engine (Native Linux Server)"},{"url":"#4-post-setup-and-migration","title":"4. Post-Setup and Migration","items":[{"url":"#verify-new-settings","title":"Verify New Settings"},{"url":"#update-existing-projects-migration","title":"Update Existing Projects (Migration)"},{"url":"#identify-legacy-networks","title":"Identify \"Legacy\" Networks"}]},{"url":"#why-this-setup","title":"Why This Setup?"}]},"parent":{"relativePath":"docker/handling-ip-conflicts-in-docker.md"},"frontmatter":{"metaTitle":"Handling IP Conflicts in Docker","metaDescription":"Learn how to avoid IP conflicts between Docker and university campus networks."}},"allMdx":{"edges":[{"node":{"fields":{"slug":"/","title":"Manuals"}}},{"node":{"fields":{"slug":"/coursepress","title":"CoursePress"}}},{"node":{"fields":{"slug":"/coursepress/om-wordpress","title":"Om CoursePress (WordPress)"}}},{"node":{"fields":{"slug":"/cumulus/cumulus-camp-server-certificate","title":"Securing Your Cumulus Campus Network Server with TLS Certificate"}}},{"node":{"fields":{"slug":"/cscloud/connect-to-server","title":"Connect to a Server"}}},{"node":{"fields":{"slug":"/cscloud","title":"CSCloud"}}},{"node":{"fields":{"slug":"/cumulus","title":"Cumulus"}}},{"node":{"fields":{"slug":"/cumulus/hide-webserver-version","title":"Hide Webserver Version"}}},{"node":{"fields":{"slug":"/cumulus/how-to-connect-to-a-cumulus-server","title":"How to Connect to a Cumulus Server"}}},{"node":{"fields":{"slug":"/docker/handling-ip-conflicts-in-docker","title":"Handling IP Conflicts in Docker"}}},{"node":{"fields":{"slug":"/gitlab/export-project","title":"Export your GitLab Projects to GitHub"}}},{"node":{"fields":{"slug":"/docker","title":"Docker"}}},{"node":{"fields":{"slug":"/gitlab/hand-in-assignment-mr","title":"Submit Assignment as Merge Request"}}},{"node":{"fields":{"slug":"/gitlab/ssh-troubleshooting","title":"SSH Troubleshooting"}}},{"node":{"fields":{"slug":"/other/azure","title":"Azure Dev Tools"}}},{"node":{"fields":{"slug":"/sandbox/basic-elements","title":"Basic elements"}}},{"node":{"fields":{"slug":"/gitlab","title":"GitLab"}}},{"node":{"fields":{"slug":"/sandbox/code","title":"Code"}}},{"node":{"fields":{"slug":"/other","title":"Other"}}},{"node":{"fields":{"slug":"/sandbox/exercise","title":"Exercises"}}},{"node":{"fields":{"slug":"/sandbox/frontmatter","title":"Frontmatter"}}},{"node":{"fields":{"slug":"/sandbox/hint","title":"Hint"}}},{"node":{"fields":{"slug":"/sandbox","title":"Sandbox"}}},{"node":{"fields":{"slug":"/sandbox/markdown-import","title":"Imported markdown"}}},{"node":{"fields":{"slug":"/sandbox/mermaid","title":"Mermaid"}}},{"node":{"fields":{"slug":"/sandbox/tabs","title":"Tabs"}}},{"node":{"fields":{"slug":"/sandbox/youtube","title":"YouTube"}}},{"node":{"fields":{"slug":"/gitlab/git/commit-messages","title":"Commit Messages"}}},{"node":{"fields":{"slug":"/gitlab/git/group-projects","title":"Group projects"}}},{"node":{"fields":{"slug":"/gitlab/git/introduction","title":"Introduction to Git"}}},{"node":{"fields":{"slug":"/gitlab/git/multiple-computers","title":"Multiple computers"}}},{"node":{"fields":{"slug":"/gitlab/git/setup","title":"Setup"}}},{"node":{"fields":{"slug":"/gitlab/git","title":"Git"}}},{"node":{"fields":{"slug":"/gitlab/git/working-with-git","title":"Working with git"}}}]}},"pageContext":{"id":"a970d707-8353-5dce-8814-2ef55f2f935a"}},
    "staticQueryHashes": ["253607798","3706406642","710574383"]}