Unable to maintain two TWS sessions at the same time



I had follow the guide line to setup a couple of IB accounts(live account and paper account) and runs on 2 TWS containers, but I keep getting error message “TWS session is connected from a different IP address” while fetching history market data, I share my experience to IB customer service and got their reply:

Per our record, you have login to TWS with a different Mac Address, if you are logging into the same device you should have the same Mac Address. Therefore, you would get the error message of “TWS session is connected from a different IP address”. Please check your computer configuration and see if you can configure your computer using the same Mac address and same IP Address.

I have configure my TWS containers to share a same mac address, but TWS no work at all.

I would see if anyone having the same problem? and is there a way to work around?


Docker assigns a unique MAC address and IP address to each container, so IB will see each quantrocket/ibg container as running from a separate location.

The suggested approach to run multiple gateways is to create a 2nd user as outlined here.