Closed mattmix closed 3 years ago
peer_port does not control the source port, only listening port for servers and in turn the destination port for the client talking to said server. This not a bug, it is how it is intended to work.
That isn't how I read the comment in the conf file:
# peer_port (port to open peer "server" connection on.) If this daemon
# is running the iperf "receiver" then it will also open a peer tcp
# connection using these port numbers.
My reading of the peer_port config option is that it will always choose a port in that range whether it is initiating a connection to the peer server or creating a listening socket.
However, on the most recent release it is binding to a random port for me when initiating a connection to the peer server (hosts have been obfuscated):
/etc/bwctl-server/bwctl-server.conf: peer_port 6001-6200
RECEIVER START bwctl: Remote 'client' (server.local) never initiated handshake: listening at port(6128) - canceling
Watching tcpdump, it tried to connect from a src port far outside the peer_port range. I did an strace on bwctld on server.local and pulled out what looked like the relevant section:
[pid 13237] bind(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("server.local")}, 16) = 0 [pid 13237] fcntl(12, F_GETFL) = 0x2 (flags O_RDWR) [pid 13237] fcntl(12, F_SETFL, O_RDWR|O_NONBLOCK) = 0 [pid 13237] connect(12, {sa_family=AF_INET, sin_port=htons(6128), sin_addr=inet_addr("server.remote")}, 16) = -1 EINPROGRESS (Operation now in progress)
My limited understanding of this is that bind should have sin_port should be a port in the the peer_port range.
I'm using the latest rpms from the internet2 repo:
This is causing issues with the router ACLs, am I misunderstanding how to set this up?