in reply to LWP and ipv4

You likely want the local_address option to the constructor, and set that to the interface address you want to use (local_address).