< Back

Test-AzureRmNetworkWatcherIPFlow

Tue Jan 29, 2019 9:58 pm

NAME Test-AzureRmNetworkWatcherIPFlow



SYNOPSIS

Returns whether the packet is allowed or denied to or from a particular destination.





SYNTAX

Test-AzureRmNetworkWatcherIPFlow [-AsJob] [-DefaultProfile <IAzureContextContainer>] -Direction {Inbound | Outbound} -LocalIPAddress <String>

-LocalPort <String> -NetworkWatcher <PSNetworkWatcher> -Protocol {TCP | UDP} -RemoteIPAddress <String> [-RemotePort <String>]

[-TargetNetworkInterfaceId <String>] -TargetVirtualMachineId <String> [<CommonParameters>]



Test-AzureRmNetworkWatcherIPFlow [-AsJob] [-DefaultProfile <IAzureContextContainer>] -Direction {Inbound | Outbound} -LocalIPAddress <String>

-LocalPort <String> -NetworkWatcherName <String> -Protocol {TCP | UDP} -RemoteIPAddress <String> [-RemotePort <String>] -ResourceGroupName

<String> [-TargetNetworkInterfaceId <String>] -TargetVirtualMachineId <String> [<CommonParameters>]





DESCRIPTION

The Test-AzureRmNetworkWatcherIPFlow cmdlet, for a specified VM resource and a packet with specified direction using local and remote, IP

addresses and ports, returns whether the packet is allowed or denied.





PARAMETERS

-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Direction <String>

Direction.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LocalIPAddress <String>

Local IP Address.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LocalPort <String>

Local Port.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-NetworkWatcher <PSNetworkWatcher>

The network watcher resource.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-NetworkWatcherName <String>

The name of network watcher.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Protocol <String>

Protocol.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RemoteIPAddress <String>

Remote IP Address.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RemotePort <String>

Remote port.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

The name of the network watcher resource group.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-TargetNetworkInterfaceId <String>

Target network interface Id.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-TargetVirtualMachineId <String>

The target virtual machine ID.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Microsoft.Azure.Commands.Network.Models.PSNetworkWatcher

System.String





OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSIPFlowVerifyResult







NOTES





Keywords: azure, azurerm, arm, resource, management, manager, network, networking, network watcher, flow, ip



--- Example 1: Run Test-AzureRmNetworkWatcherIPFlow ---



$nw = Get-AzurermResource | Where {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" }

$networkWatcher = Get-AzureRmNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName

$VM = Get-AzurermVM -ResourceGroupName testResourceGroup -Name VM0

$Nics = Get-AzureRmNetworkInterface | Where {$_.Id -eq $vm.NetworkInterfaceIDs.ForEach({$_})}



Test-AzureRmNetworkWatcherIPFlow -NetworkWatcher $networkWatcher -TargetVirtualMachineId $VM.Id -Direction Outbound -Protocol TCP -LocalIPAddress

$nics[0].IpConfigurations[0].PrivateIpAddress -LocalPort 6895 -RemoteIPAddress 204.79.197.200 -RemotePort 80



Get's the Network Watcher in West Central US for this subscription, then gets the VM and it's associated Network Interfaces. Then for the first

Network Interface, runs Test-AzureRmNetworkWatcherIPFlow using the first IP from the first Network Interface for an outbound connection to an IP

on the internet.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... cheripflow

New-AzureRmNetworkWatcher

Get-AzureRmNetworkWatcher

Remove-AzureRmNetworkWatcher

Get-AzureRmNetworkWatcherNextHop

Get-AzureRmNetworkWatcherSecurityGroupView

Get-AzureRmNetworkWatcherTopology

Start-AzureRmNetworkWatcherResourceTroubleshooting

New-AzureRmNetworkWatcherPacketCapture

New-AzureRmPacketCaptureFilterConfig

Get-AzureRmNetworkWatcherPacketCapture

Remove-AzureRmNetworkWatcherPacketCapture

Stop-AzureRmNetworkWatcherPacketCapture