Geometrically confined superconductors often experience a breakdown in the quantization of magnetic flux owing to the incomplete screening of the supercurrent against field penetration. In this study, we report that magnetic field confinement occurs regardless of the dimensionality of the system, even extending to 1D linear potential systems. By using a vector-field magnetic force microscope, we successfully create a vortex‒antivortex pair connected by a 1D unquantized magnetic flux in ultrathin superconducting films. Through an investigation of the manipulation and thermal behavior of the vortex pair, we uncover a long-range interaction mediated by the unquantized magnetic flux. These findings suggest a universal phenomenon of unquantized magnetic flux formation, independent of the geometry of the system. Our results present an experimental route for investigating the impact of confinement on superconducting properties and order parameters in unconventional superconductors characterized by extremely low dimensionality.