Bug 128770 - ifconfig conflict with ip command
Summary: ifconfig conflict with ip command
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: net-tools
Version: 2.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokál
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-07-29 10:49 UTC by Daggrass
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-10-19 19:22:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daggrass 2004-07-29 10:49:13 UTC
Description of problem:

It find conflict when use net tools ifconfig and ip command.


Version-Release number of selected component (if applicable):
  net-tools 1.60
  ifconfig 1.42 (2001-04-13)
      &
  ip utility, iproute2-ss010824
 
How reproducible:
   Config the interface ip address when one interface(eth0) need 
multi address.

Steps to Reproduce:
1. ifconfig eth0 1.1.2.2 netmask 255.255.255.0 
2. ip addr add dev eth0 1.1.2.8/32
3. ifconfig eth0 1.1.2.3 netmask 255.255.255.0

  
Actual results:
# ip addr ls dev eth0 

12: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast 
qlen 100 
link/ether 00:c0:4c:39:08:51 brd ff:ff:ff:ff:ff:ff 
inet 1.1.2.3/8 brd 1.255.255.255 scope global eth1 
inet 1.1.2.8/24 scope global eth1 


Expected results:

# ip addr ls dev eth0 

12: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast 
qlen 100 
link/ether 00:c0:4c:39:08:51 brd ff:ff:ff:ff:ff:ff 
inet 1.1.2.3/24 brd 1.255.255.255 scope global eth1 
inet 1.1.2.8/32 scope global eth1 


Additional info:

kernel version: 2.4.24

Comment 1 Phil Knirsch 2004-07-29 13:02:30 UTC
Erh, your actual and expected results are identical.

And secondly, you are using an unsupported kernel. Please reproduce
the problem with the latest errata kernel available via RHN.

Thanks,

Read ya, Phil

Comment 2 Daggrass 2004-07-30 01:26:00 UTC
my actual and expected results are not identical.

my expected results is :

	inet 1.1.2.3/24 brd 1.255.255.255 scope global eth1 
	inet 1.1.2.8/32 scope global eth1 

but is not :

	inet 1.1.2.3/8 brd 1.255.255.255 scope global eth1 
	inet 1.1.2.8/24 scope global eth1 

    What I expected  are the masks is 24 for 1.1.2.3 and 32 for 
1.1.2.8; 
but what actually results are the masks is  8 for 1.1.2.3 and 24 for 
1.1.2.8. 


Comment 3 Daggrass 2004-07-30 06:09:47 UTC
sorry, 
Maybe there exist other problem :
when add a address to a interface, e.g:
    #ifconfig eth0 1.1.2.3 netmask 255.255.255.0
then show the address :
    #ip addr ls dev eth0 
the result may like :
   inet 1.1.2.3/24 brd 1.255.255.255 scope global eth0
but i think that it should is: 
   inet 1.1.2.3/24 brd 1.1.2.255 scope global eth0

also, the mask has problem ?  

Can someone explain to me ? 

Thanks a lot.

Dag.Lee



Comment 4 Daggrass 2004-07-30 07:07:52 UTC
sorry, 
In Additional Comment #3, 
I take the  boardcast for netmask. 




Dag.Lee

Comment 5 Radek Vokál 2004-11-24 12:39:50 UTC
Broadcast adress is computed according to IP class and not according
to netmask. This bug is already fixed in ifconfig which now computes
broadcast adress from netmask. Workaround is simple, just specify
broadcast adress and netmask when setting up ip. For the first
described problem here, I've tested it here and I don't see the
problem. Seems to work fine, tested with net-tools-1.60-40 and
iproute-2.6.9-4 (041019).

Comment 6 Daggrass 2004-11-29 04:52:14 UTC
to Radek Vokál : 
  Thank u for your reply.
  I tested with net-tools-1.60-40 and iproute-2.6.9-4 yesterday, but 
 the problem still exists.
 
   This  problem only occurs when config device multi  address used 
command ifconfig 
   & ip alternate .
   
   first . config device using command ifconfig : 
     	 ifconfig eth0 11.1.1.1 netmask 255.255.255.0 broadcast 
11.1.1.255 
        now see the eth0 config using command ip : 
       	ip addr  ls dev eth0 
        the result is : 
      	 inet 192.168.100.169/24
        it's right .  
        
        
   second , add a ip (netmask is 32) to device using command ip:
   	ip addr add dev eth0 11.1.1.2/32
        now see the eth0 config using command ip :
        	ip addr ls dev eth0 
        the result is :
        	inet 11.1.1.1/24 
	inet 11.1.1.2/32 
        it's  correct too.
                
        
     third, config device using command ifconfig again: 
     	     ifconfig eth0 11.1.1.3 netmask 255.255.255.0 broadcast 
11.1.1.255
           now see the eth0 config using command ip :
           	ip addr ls dev eth0 
           the result is:
           	inet 11.1.1.2/24 
	        inet 11.1.1.3/8 	
      It's error, the result isn't the result that I expect. 
      I expect results are :
     	       inet 11.1.1.2/32 
	       inet 11.1.1.3/24
	
BTW: I tested under RHAS3.0, but update iproute2 & net-tools packets.


Comment 7 RHEL Program Management 2007-10-19 19:22:01 UTC
This bug is filed against RHEL2.1, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products.  Since
this bug does not meet that criteria, it is now being closed.

For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/

If you feel this bug is indeed mission critical, please contact your
support representative.  You may be asked to provide detailed
information on how this bug is affecting you.


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