Another solution is to bridge WSL2 directly to the relevant network adapter. I tried doing it within Hyper-V, but couldn't get it to work. However, what did work was going to Control Panel\Network and Internet\Network Connections, selecting the NIC (Ethernet 3 in my case) and vEthernet (WSL) and bridging them by right clicking and selecting "Bridge Connections":