I have created a provider hosted app, my MVC web application is hosted on IIS, I am able to access my web application with both lan ip and public ip from my PC, our office network uses Cyberroam and my network administrator has provided me external IP of the host machine which is accessible publicly.
I have registered my app on AppRegexNew.aspx, and configured it to use the local IP of host machine, for example: 192.165.5.25
After deploying it to my Sharepoint Developer's site it is installing and working perfectly and is accessible inside our LAN network. But when I registered a new app configured with public ip of host machine for example: 120.***.***.***
(I also updated app manifest and web.config of MVC site properly with new client id and made sure to remove previous versions of the app from developer site ), the app takes too long for installation and then fails with error message "Sorry, something went wrong with adding the app". I tried doing it multiple times, the app with local ip installs and runs smoothly but the app with public ip doesn't. What can be the possible solution to this?