Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue setting RemoteAddresses of a FirewallRule with a range of IPv6 addresses #47

Open
nmehtaMS opened this issue Aug 11, 2021 · 0 comments

Comments

@nmehtaMS
Copy link

nmehtaMS commented Aug 11, 2021

For the following code

rule.RemoteAddresses = remoteAddresses;

when assigning an array of remoteAddresses which includes an IPv6 address range eg
1234:1030:20e:3::6f/127
start IP 1234:1030:20e:3::6e
last IP 1234:1030:20e:3::6f

it fails to set the remoteAddresses property and throws an exception

Exception Stack Trace
" at WindowsFirewallHelper.COMInterop.INetFwRule.set_RemoteAddresses(String value)\r\n at WindowsFirewallHelper.FirewallRules.FirewallWASRule.set_RemoteAddresses(IAddress[] value) in C:\Users\s_fal\Documents\Personal\Open-Source Projects\WindowsFirewallHelper\WindowsFirewallHelper\FirewallRules\FirewallWASRule.cs:line 584\r\n at FirewallService.CreateFirewallRule(String name, FirewallAction action, FirewallDirection direction, FirewallProtocol protocol, UInt16[] destinationPortsList, IAddress[] remoteAddresses, IAddress[] localAddresses) in ...

This works fine when the IPv6 CIDR is /128 eg 1234:1030:20e:3::6f/128

Images for context

MicrosoftTeams-image
MicrosoftTeams-image (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant