Uncertain. Per De Vaan, potentially a loanword; it is possibly related to nassa (“fish-trap made of wickerwork”) and necto (“I bind”).
One theory derives it from Proto-Indo-European *gned-, *gnod- (“to bind”) and makes it cognate to Proto-Germanic *knuttô (“knot”) (whence Modern English knot).
Another theory derives it from Proto-Indo-European *ned- (“to turn, twist, knot”), whence English net and possibly nettle, Avestan 𐬥𐬀𐬯𐬐𐬀- (naska-, “bundle”), Old Irish nascim (“to bind”).