{"record":{"id":"50a06d2dcae0fba9","repo":"hashicorp/vagrant","slug":"the-provided-gateway-ip-gateway-is-not-within","errorCode":null,"errorMessage":"The provided gateway IP (%{gateway}) is not within the defined\nsubnet (%{subnet}). Please provide an IP address within the\ndefined subnet.","messagePattern":"The provided gateway IP \\(%(.+?)\\) is not within the defined\nsubnet \\(%(.+?)\\)\\. Please provide an IP address within the\ndefined subnet\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/providers/docker/action/prepare_networks.rb","lineNumber":253,"sourceCode":"        # @param [Hash] env Local call env\n        # @return [String] Gateway address\n        def request_public_gateway(network_options, interface, env)\n          subnet = IPAddr.new(network_options[:subnet])\n          gateway = nil\n          while !gateway\n            gateway = env[:ui].ask(I18n.t(\n              \"docker_provider.network_bridge_gateway_request\",\n              interface: interface,\n              default_gateway: network_options[:gateway]) + \" \",\n              prefix: false\n            ).strip\n            if gateway.empty?\n              gateway = network_options[:gateway]\n            end\n            begin\n              gateway = IPAddr.new(gateway)\n              if !subnet.include?(gateway)\n                env[:ui].warn(I18n.t(\"docker_provider.network_bridge_gateway_outofbounds\",\n                  gateway: gateway,\n                  subnet: network_options[:subnet]) + \"\\n\", prefix: false)\n              end\n            rescue IPAddr::InvalidAddressError\n              env[:ui].warn(I18n.t(\"docker_provider.network_bridge_gateway_invalid\",\n                gateway: gateway) + \"\\n\", prefix: false)\n              gateway = nil\n            end\n          end\n          gateway.to_s\n        end\n\n        # Request the IP range allowed for use by docker when creating a new\n        # public network\n        #\n        # TODO: When the Vagrant installer upgrades to Ruby 2.5.x,\n        # remove all instances of the roundabout way of determining a prefix\n        # and instead just use the built-in `.prefix` method","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/docker/action/prepare_networks.rb#L235-L271","documentation":"Error \"The provided gateway IP (%{gateway}) is not within the defined\nsubnet (%{subnet}). Please provide an IP address within the\ndefined subnet.\" thrown in hashicorp/vagrant.","triggerScenarios":"Thrown at plugins/providers/docker/action/prepare_networks.rb:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}