What is my IP with a twist

Notice: This post does not contain any pictures. They were all lost during the import from my old Gonjer.com site. I do apologize for that but I hope that the post will still help.

I needed a tool, preferably a Powershell script, which could show my WAN IP address using alternate outgoing TCP ports, other then default http/s (80 & 443) when using websites like whatismyip.com.

The reason for this is that I use multiple WAN/VPN connections based on protocol for different purposes like web surfing uses one WAN/VPN connection and all other protocols uses the default WAN gateway.
I use pFsense Firewall in my home lab and create firewall rules with an advanced settings and choose a Gateway other than the default like the example below:
Picture: pFsense Firewall Advanced Rules

For the tool, script or function I needed a site or service which responds to all different protocols. The one i found that were free, simple and used most ports in the TCP range, 1-65535, was portquiz.net.
The decision wasn’t hard, create a Powershell function that leverage the cmdlet Invoke-WebRequest to parse the content of the site and match against keywords using regular expressions.

This is the result:

DISCLAIMER: This script is published on “As Is” basis. I will not take any responsibility for any damage this script might do to your production or test server environment. Please ensure that you test this properly in a non-production environment before running or scheduling the script in a production environment.

Leave a Comment

Your email address will not be published. Required fields are marked *

Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Unclosed quotation mark after the character string 'O:30:"ActionScheduler_SimpleSchedule":2:{s:22:"'. in D:\home\site\wwwroot\wp-content\plugins\wpforms-lite\vendor\woocommerce\action-scheduler\classes\migration\ActionScheduler_DBStoreMigrator.php:44 Stack trace: #0 D:\home\site\wwwroot\wp-content\plugins\wpforms-lite\vendor\woocommerce\action-scheduler\classes\data-stores\ActionScheduler_HybridStore.php(225): ActionScheduler_DBStoreMigrator->save_action(Object(ActionScheduler_Action), NULL) #1 D:\home\site\wwwroot\wp-content\plugins\wpforms-lite\vendor\woocommerce\action-scheduler\classes\ActionScheduler_ActionFactory.php(177): ActionScheduler_HybridStore->save_action(Object(ActionScheduler_Action)) #2 D:\home\site\wwwroot\wp-content\plugins\wpforms-lite\vendor\woocommerce\action-scheduler\classes\ActionScheduler_ActionFactory.php(84): ActionScheduler_ActionFactory->store(Object(ActionSc in D:\home\site\wwwroot\wp-content\plugins\wpforms-lite\vendor\woocommerce\action-scheduler\classes\migration\ActionScheduler_DBStoreMigrator.php on line 44