{"record":{"id":"e7db2050e0a6f139","repo":"netbirdio/netbird","slug":"s-is-not-a-valid-input-for-s-it-should-not-cont","errorCode":null,"errorMessage":"%s is not a valid input for %s. it should not contain two interface names","messagePattern":"(.+?) is not a valid input for (.+?)\\. it should not contain two interface names","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"client/cmd/up.go","lineNumber":759,"sourceCode":"\t\t}\n\n\t\tsubElements := strings.Split(element, \"/\")\n\t\tif len(subElements) > 2 {\n\t\t\treturn fmt.Errorf(\"%s is not a valid input for %s. it should be formatted as \\\"String\\\" or \\\"String/String\\\"\", element, externalIPMapFlag)\n\t\t}\n\n\t\tif len(subElements) == 1 && !isValidIP(subElements[0]) {\n\t\t\treturn fmt.Errorf(\"%s is not a valid input for %s. it should be formatted as \\\"IP\\\" or \\\"IP/IP\\\", or \\\"IP/Interface Name\\\"\", element, externalIPMapFlag)\n\t\t}\n\n\t\tlast := 0\n\t\tfor _, singleElement := range subElements {\n\t\t\tinputType, err := validateElement(singleElement)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"%s is not a valid input for %s. it should be an IP string or a network name\", singleElement, externalIPMapFlag)\n\t\t\t}\n\t\t\tif last == interfaceInputType && inputType == interfaceInputType {\n\t\t\t\treturn fmt.Errorf(\"%s is not a valid input for %s. it should not contain two interface names\", element, externalIPMapFlag)\n\t\t\t}\n\t\t\tlast = inputType\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc parseInterfaceName(name string) error {\n\tif runtime.GOOS != \"darwin\" {\n\t\treturn nil\n\t}\n\n\tif strings.HasPrefix(name, \"utun\") {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"invalid interface name %s. Please use the prefix utun followed by a number on MacOS. e.g., utun1 or utun199\", name)\n}","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/up.go#L741-L777","documentation":"validateNATExternalIPs tracks the type of each sub-element; a pair where both sides are interface names (interfaceInputType twice in a row) is rejected, because the mapping needs at least one concrete address to be meaningful for NAT.","triggerScenarios":"Values like \"eth0/wlan0\" — two interface names with no IP on either side of the '/'.","commonSituations":"Misunderstanding the flag as a general interface pair, or accidentally swapping the intended IP for a second interface name.","solutions":["Put an IP on one side: \"1.2.3.4/eth0\"","If two mappings were intended, pass them as separate comma-separated elements"],"exampleFix":"# before\nnetbird up --external-ip-map \"eth0/wlan0\"\n# after\nnetbird up --external-ip-map \"192.0.2.10/eth0\"","handlingStrategy":"validation","validationCode":"for _, e := range list {\n\tparts := strings.Split(e, \"/\")\n\tif len(parts) == 2 && net.ParseIP(parts[0]) == nil && net.ParseIP(parts[1]) == nil {\n\t\treturn fmt.Errorf(\"%q pairs two interface names; one side must be an IP\", e)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mentally model the flag as 'which IP should peers see' — an address is always required"],"tags":["go","netbird","cli","validation","nat","external-ip-map"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}