Connect: cannot assign requested address

Hi all,
I have an api-endpoint which is masked by ip rate limiter. I have used --local-ips to assign a ip-block, but when I execute the script I keep getting

dateaddress": dial tcp 192.168.20.12:0->10.112.49.53:443: bind: can’t assign requested address"

I read a post on how it can be overcomed in linux using by setting tcp_tw_reuse, but I want to know how it can be resolved in Macos. Is there anyway to make k6 use different ports for each request, since all the requests currently are made from port 0

Hi @mahesh4,
welcome to the community forum :tada:

dateaddress": dial tcp 192.168.20.12:0->10.112.49.53:443: bind: can’t assign requested address"

This error is not specifically for macOS, it tells you that the provided IP is not available for your network or it’s already in use.

You should provide an assigned IP from your networks, you could execute hostname -I (or equivalent) to check them.

Is there anyway to make k6 use different ports for each request, since all the requests currently are made from port 0

port 0 is a wildcard port so the OS can assign one available as an outgoing port, why would you use a specific one?