1.18.2 forge server has issue - Authentication servers are down - when i try to join

So i have created a forge server (the error shows whenever it has mods or it doesnt) on my linux machine and i tried using TCP and Minecraft Java tunnels but both have the same issue. The server appears to be online and sends server information to the server list on the client side (Windows pc) but whenever i try to connect it appears to be stuck on encrypting screen for couple of seconds and after that it gives me message that the authentications servers are down. I tried to flush dns and set it to the googles default on both computers. The server is set to online-mode but when i set it to the offline mode it magiclly works. It also works on every type of minecraft except forge online-mode=true. Anyone knows how to fix this please?