# Steps to reproduce Assume $HOST is the host IP address and $GW is the gateway address: 1. On host, run: $ socat -u UDP4-LISTEN:2000,bind=$HOST STDOUT 2. On host, run: $ tcpdump -i lo 3. On host, run: $ pasta --config-net 4. Within pasta shell run: # echo hello | socat -u STDIN UDP4:$GW:2000 # Expected results "hello" appears on socat from step (1). tcpdump at (2) shows no packets related to this operation. # Actual results No output on the host listening socat, UDP packet with "hello" appears on the host loopback interface.
It looks like this is because the sockets created for forwarding the output packets are bound to UNSPEC, meaning that when delivering to the host via gateway translation they use loopback.
I based this on a misunderstanding of how the $GW translation is supposed to work. After discussing with Stefano the meaning of GW translation, the consensus was that $GW in the guest/ns represents the host's loopback address as seen from the host. There are still some weird edge cases with $GW translation, but this specific example is working as intended.