Open geoffbrucepayne opened 2 years ago
facing same issue.
I've tested this on my machine (windows - client.connect("mqtt.eclipseprojects.io", 1883, 60, bind_address="192.168.168.240", bind_port=0)
and it appeared to work as designed (switching to another interface address resulted in a change to the source IP shown in wireshark).
Can you please provide more information (ideally a minimal, reproducible example along with a description of your network configuration and OS info). Before doing this you might find this answer on stack overflow of interest...
I am running on a Raspberry Pi with multiple network interfaces, and need to exclusively use one of those interfaces for the MQTT client. When I specify
bind_addess='192.168.128.102'
(eth2) in my client.connect() call, the connection is still being initiated on another address/interface 192.168.1.129 (eth0) which I confirmed by wireshark trace. Am I doing something wrong or is there a better way to force a specific interface?