Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

use cidr-tools to validate gateway is inRange #538

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

Omarabdul3ziz
Copy link
Contributor

Changes

  • add validation on the gateway to make sure it is in the range of the provided ips.
  • add cidr-tools package

Related issues

@Mahmoud-Emad
Copy link
Contributor

Based on testing, the issue is still there.

I tried a valid IP and it accepted and created

image

but it should accept only public IP, it should tell me that this is not a pub ip

image

and if I submit it, it fails.

image

image

@Mahmoud-Emad Mahmoud-Emad self-requested a review March 5, 2023 11:19
@Omarabdul3ziz
Copy link
Contributor Author

Actually 192.167.. is a valid public ip from class C. as well 1.1.1.1 from class A

The reserved Ips for private networks is

  • Class A: 10.0.0.0 to 10.255.255.255
  • Class B: 172.16.0.0 to 172.31.255.255
  • Class C: 192.168.0.0 to 192.168.255.255

i tried it and it worked
image

and the validation looks working on the out range IPs
image

Can you re test it please?

@Omarabdul3ziz Omarabdul3ziz merged commit 3a4950c into development Mar 8, 2023
@Omarabdul3ziz Omarabdul3ziz deleted the development_ip-validation branch March 8, 2023 09:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants