Bug 1383370 - [RFE] Validate the IPv4 address of a host
Summary: [RFE] Validate the IPv4 address of a host
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: network-manager-applet
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-10 13:21 UTC by Pavlin Georgiev
Modified: 2016-10-21 07:58 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-21 07:58:04 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Pavlin Georgiev 2016-10-10 13:21:16 UTC
Description of the problem:
In IPv4 addressing a host should not have an address which is:
  A) subnet ID
  B) broadcast address
The default gateway should be in the same subnet as the host. Otherwise it's unreachable from the host.

Example
IPv4 class A
Subnet ID: 10.0.0.0
Subnet Mask: 255.240.0.0
Mask Bits: 12
Host Address Range: 10.0.0.1 - 10.15.255.254
Broadcast Address: 10.15.255.255

(Note: In this context, IP: 10.10.0.0 is a valid host address. The same is true for 10.10.10.0.)


IPv4 class B
Subnet ID: 172.16.64.0
Subnet Mask: 255.255.192.0
Mask Bits: 18
Host Address Range: 172.16.64.1 - 172.16.127.254
Broadcast Address: 172.16.127.255

(Note: In this context, IP: 172.16.65.0 is a valid host address. The same is true for 172.16.127.0.)


IPv4 class C
Subnet ID: 192.168.0.96
Subnet Mask: 255.255.255.240
Mask Bits: 28
Host Address Range: 192.168.0.97 - 192.168.0.110
Broadcast Address: 192.168.0.111


The unreachable gateway
Subnet ID: 192.168.0.0
Subnet Mask: 255.255.255.192
Mask Bits: 26
Host Address Range: 192.168.0.1 - 192.168.0.62
Broadcast Address: 192.168.0.63

The default gateway should be in the host address range.
The address 192.168.0.254 is outside of the subnet.


OS: RHEL Workstation release 7.3 (Maipo)
Kernel: kernel-3.10.0-512.el7.x86_64
Version-Release number of selected component (if applicable):
network-manager-applet-1.4.0-2.el7.x86_64
nm-connection-editor-1.4.0-2.el7.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Start nm-connection editor
2. Add a new connection
3. Chose type Ethernet
4. Open tab "IPv4 Settings"
5. Add an IP address which coincides with
    A) subnet ID
        IP: 192.168.0.64, netmask: 255.255.255.192, gateway: 192.168.0.126
    B) broadcast address
        IP: 192.168.0.127, netmask: 255.255.255.192, gateway: 192.168.0.126
6. Set a gateway that is outside of the current subnet
IP: 172.16.0.1, netmask: 255.255.240.0, gateway: 172.16.16.254


Actual results:
The nm-connection-editor accepts the IPv4 address of a host to be a subnet ID or a broadcast address.


Expected results:
The nm-connection-editor does not allow the IPv4 address of a host to be a subnet ID or a broadcast address.


Additional info:
An on-line subnet calculator is used for better overview of subnetting:
http://www.subnet-calculator.com/

Comment 1 Thomas Haller 2016-10-12 14:05:52 UTC
kernel allows both to configure the network address and the broadcast address (for example using `ip addr add`).

Why do you think NetworkManager should disallow it?

Comment 2 Pavlin Georgiev 2016-10-21 07:58:04 UTC
(In reply to Thomas Haller from comment #1)
> kernel allows both to configure the network address and the broadcast
> address (for example using `ip addr add`).
> 
> Why do you think NetworkManager should disallow it?

Hi Thomas,

My job is to test the current functionality of Linux.
It is true that I cannot disallow something that is allowed by the kernel.
To change the functionality of NetworkManager is for someone who is architect or software developer.
I cannot take such a decision from the position of software tester.
Hence, I close this request.


Note You need to log in before you can comment on or make changes to this bug.