Skip to content

Instantly share code, notes, and snippets.

@p0onage
Last active June 30, 2022 10:29
Show Gist options
  • Save p0onage/a36d6356929fc63982b918cd1ac69763 to your computer and use it in GitHub Desktop.
Save p0onage/a36d6356929fc63982b918cd1ac69763 to your computer and use it in GitHub Desktop.
Add Teams Media IP subnets into the route table
$intIndex = "" # index of the interface connected to the internet
$gateway = "" # default gateway of that interface (change this)
# Query the web service for IPs in the Optimize category
$destPrefix = "52.120.0.0/14", "52.112.0.0/14", "13.107.64.0/18" # Teams Media endpoints
# Add routes to the route table
foreach ($prefix in $destPrefix) {New-NetRoute -DestinationPrefix $prefix -InterfaceIndex $intIndex -NextHop $gateway}
@davebutterworth
Copy link

It's simple to remove them, you can type "route print" to print the routing table
then do 

route -p delete 52.120.0.0/14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment