Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does the user login restriction based on IP address support ipv6 for web application?

Does any one know how to restrict the user to login based on an IPV6 address for a web application in c# dot net?

I have already done the functionality using IPV4 and it's working fine, but I wanted to restrict the user based on their IPV6 for the web application.

Is this possible?

like image 981
DOTNET Team - WeblineIndia Avatar asked Dec 11 '17 12:12

DOTNET Team - WeblineIndia


1 Answers

In general, yes you can get client IPv6 address via C# code and implements IPv6 restrictions with using HttpRequest.UserHostAddress as mentioned in this question or more accurate with using HTTP_X_FORWARDED_FOR server variable as described in here. If request is made via IPv6 you will have this IP in HTTP_X_FORWARDED_FOR server variable.

You can also use IIS IP address restriction module to configure IPv4 or IPv6 restrictions. Of cause your server application should be configured to work with IPv6.

Take also into account that in Internet mostly you can get IP given by your Internet provider, not real client machine IP. In local networks apparently you can see real IP. It's the same like you see your IP address here, it is different that you see in ipconfig or ifconfig commands.

like image 193
Vasyl Zv Avatar answered Sep 21 '22 11:09

Vasyl Zv