Hello,
One computer on my LAN is running the IB Gateway and another is running scripts that connect to the IB Gateway. I am able to connect to the gateway, but I am not getting responses from the API:
?curl -v " -d "{"symbol": "GWO","secType": "STK"}"
*?? Trying 192.168.1.10:4002...
* Connected to 192.168.1.10 (192.168.1.10) port 4002 (#0)
POST /v1/api/trsrv/stocks HTTP/1.1
Host: 192.168.1.10:4002
User-Agent: curl/7.74.0
Accept: */*
Content-Length: 26
Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 26 out of 26 bytes
After that, it just sits there waiting for a response. I have got log and API messages visible on the gateway and cannot see any trace of the (supposedly) incoming requests.
The same result with python code (no surprise, I suppose):
import requests
r = requests.post(", data='{"symbol": "GWO","secType": "STK"}')
No connection errors, but it just sits there.
The configuration of the IB Gateway (v.10.12):
- All default except that "Allow connections from localhost only" has been disabled, and I have added the client machine to the Trusted IPs list.
Gateway network and firewall:
inet 192.168.1.10/24 brd 192.168.1.255 scope global noprefixroute enp2s0
$ sudo ufw status
Status: active
To???????????????????????? Action????? From
--???????????????????????? ------????? ----
22/tcp???????????????????? ALLOW?????? Anywhere
80/tcp???????????????????? ALLOW?????? Anywhere
443/tcp??????????????????? ALLOW?????? Anywhere
4002?????????????????????? ALLOW?????? Anywhere
4001?????????????????????? ALLOW?????? Anywhere
4000?????????????????????? ALLOW?????? Anywhere
22/tcp (v6)??????????????? ALLOW?????? Anywhere (v6)
80/tcp (v6)??????????????? ALLOW?????? Anywhere (v6)
443/tcp (v6)?????????????? ALLOW?????? Anywhere (v6)
4002 (v6)????????????????? ALLOW?????? Anywhere (v6)
4001 (v6)????????????????? ALLOW?????? Anywhere (v6)
4000 (v6)????????????????? ALLOW?????? Anywhere (v6)
Client machine network and firewall:
inet 192.168.1.106/24 brd 192.168.1.255 scope global noprefixroute wlp0s20f3
$ sudo ufw status
Status: active
To???????????????????????? Action????? From
--???????????????????????? ------????? ----
22/tcp???????????????????? ALLOW?????? Anywhere
59000????????????????????? ALLOW?????? Anywhere
4002?????????????????????? ALLOW?????? Anywhere
22/tcp (v6)??????????????? ALLOW?????? Anywhere (v6)
59000 (v6)???????????????? ALLOW?????? Anywhere (v6)
4002 (v6)????????????????? ALLOW?????? Anywhere (v6)
Log and ini-file enclosed.
Any help much appreciated.
Best regards,
Eric Eikrem