@alok.nayak Do you have Static IP address? If yes, I assume it is a static IPv4 address.
If this IP is already added in the Dhan portal and you are still receiving an “INVALID IP” error in the order response, the issue could be due to how operating systems handle network traffic.
Most modern operating systems (including Windows and Linux) prefer IPv6 over IPv4 by default. And since your IPv6 is not static, it’s dynamic, it is quite possible that it is changing quite often. Whenever you’re placing an order it has already changed or so you should rely on IPv4.
You should change your operating system configuration to always give priority to IPv4 over IPv6.
Solution: Prefer IPv4 over IPv6
For Windows
Option 1 (Persistent)
Open Command Prompt as Administrator and run:
reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 32 /f
Then restart your system.
This ensures Windows consistently prefers IPv4.
Option 2 (Temporary – Not persistent and rest on restart)
netsh interface ipv6 set prefixpolicy ::ffff:0:0/96 60 4
Note: This resets after reboot.
Linux
Preferred Method (Persistent – Recommended)
Edit the address selection policy:
sudo nano /etc/gai.conf
Uncomment or add the following line:
precedence ::ffff:0:0/96 100
Save the file.
This makes Linux prefer IPv4 over IPv6 (similar to Windows prefix policy).
Apply changes
Usually no reboot is required, but you can restart networking:
sudo systemctl restart networking
Verify
getent ahosts google.com
if IPv4 appears first, the preference is working.