0

I am developing a code to validate that an IP and Subnet IP combination is a valid one. Say the IP address is 192.179.10.105 and its subnet mask is 255.255.0.0 - so what are the validations we can make to check that IP and Subnet combinations is valid.

I am assuming that the we can only check that IP address should not be 192.179.0.0 and 192.179.255.255 - is it correct or is there any other validation we can make?

11
  • Huh? Valid in what sense? Commented Jul 7, 2018 at 3:12
  • Please let me know what checks can we make from a given IP and subnet / subnet masks? Commented Jul 7, 2018 at 3:14
  • 1
    Your question is too broad and doesn't really get any kind of point across. Any ip address can work with any subnet mask depending on the subnetting scheme that's being used. It all depends on the schema of your network. If you need help with this then there is software that you can use to plan and manage the subnetting that you are using. Commented Jul 7, 2018 at 3:53
  • 1
    Actually it makes sense. Subnet must be binary 1's followed by 0's, all other numbers are bad. IP Address with only 0 or 1 within a subnet is illegal. That is it. Commented Jul 7, 2018 at 4:07
  • 1
    No. 192.179.1.1 is completely fine as it's 0000000100000001 i.e. having both 0 and 1. Commented Jul 7, 2018 at 6:38

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.