I have two Ubuntu Virtual Machines behind an Azure Load Balancer. I'm observing some inconsistencies with the source IP addresses set in outgoing UDP packets from the VM's. I'm trying to come up with a simple ncat
command or script that I can run on the VM's to test the source IP's.
My idea is to create a circular path (note the Load Balancer is transparent as far as the scripts and test go):
client -> LB -> VM1 -> VM2 -> LB -> client
What I can't workout is how to pass the command through VM1 to VM2 to get it to execute a connection back to the client.
I'm thinking it needs to be the same command on VM1 and VM2:
ncat --sh-exec "/bin/bash" -k -u -l 1235
And the client connects to VM1 and sends it a command which gets through to VM2 and cause it to execute an ncat connection back to the client:
ncat -u 10.0.0.4 1235
echo "ncat -u $NCAT_REMOTE_ADDR $NCAT_REMOTE_PORT" | ncat -u 10.0.0.7 1235
```
The connection makes it to VM2 but not back to the client.