Bug 143981

Summary: ifconfig & "netstat -i" report incorrect statistics for virtual interfaces
Product: Red Hat Enterprise Linux 3 Reporter: Mustafa Mahudhawala <mmahudha>
Component: net-toolsAssignee: Radek Vokál <rvokal>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: faris.xiao, kzak
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-19 18:48:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
the patch that fix alias statistics problem none

Description Mustafa Mahudhawala 2005-01-03 10:12:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)
Gecko/20040924

Description of problem:
For virtual interfaces created using the ifcfg-ethN:X scripts the
ifconfig and netstat -i report statistics of the last real adapter
listed in /proc/dev/net

Agreed, that "ip" is the recommended way to create aliases, and also
the man pages of ifconfig/netstat clearly mention that the respective
commands will not provide statistics for virtual interfaces,
nevertheless, ifconfig/netstat should atleast report the statistics of
the parent device i.e. the real interface to which the virtual
interface is aliased to.

At the minimum, ifconfig/netstat should atleast report 0 for
statistics of virtual interfaces.

Version-Release number of selected component (if applicable):
net-tools-1.60-20E.1

How reproducible:
Always

Steps to Reproduce:
1.Create virtual interfaces using ifcfg scripts in
/etc/sysconfig/network-scripts/
2.Check interface statistics (like RX/TX) for these virtual interfaces
using ifconfig or netstat -i

    

Actual Results:  # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0D:88:45:75:3F
          inet addr:10.0.0.11  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:316 (316.0 b)  TX bytes:1396 (1.3 Kb)
          Interrupt:9 Base address:0xd700
 
eth0:1    Link encap:Ethernet  HWaddr 00:0D:88:45:75:3F
          inet addr:10.0.0.12  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9753 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6738 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:892852 (871.9 Kb)  TX bytes:1375163 (1.3 Mb)
          Interrupt:9 Base address:0xd700
 
eth1      Link encap:Ethernet  HWaddr 00:0F:1F:87:0C:69
          inet addr:172.31.0.22  Bcast:172.31.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9753 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6738 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:892852 (871.9 Kb)  TX bytes:1375163 (1.3 Mb)
          Base address:0xdd40 Memory:fcfe0000-fd000000
 
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1372 (1.3 Kb)  TX bytes:1372 (1.3 Kb)
 
# netstat -i
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR
TX-DRP TX-OVR Flg
eth0       1500   0        4      0      0      0       22      0    
 0      0 BMRU
eth0:1     1500   0     9779      0      0      0     6753      0    
 0      0 BMRU
eth1       1500   0     9779      0      0      0     6753      0    
 0      0 BMRU
lo        16436   0       16      0      0      0       16      0    
 0      0 LRU
#


Expected Results:  ifconfig/netstat should report the statistics of
virtual interface (eth0:1 in above eg.), using the parent interface
(eth0 in above eg.) and not using the last device listed in
/proc/dev/net (eth1 in above eg.)

Additional info:

# uname -rm
2.4.21-27.0.1.EL i686

# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 3 (Taroon Update 4)

# lspci -n | grep "Class 0200"
02:09.0 Class 0200: 1186:1300 (rev 10)
02:0c.0 Class 0200: 8086:100e (rev 02)

02:09.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10)
02:0c.0 Ethernet controller: Intel Corp. 82540EM Gigabit Ethernet
Controller (rev 02)

Comment 1 Mustafa Mahudhawala 2005-01-03 10:23:10 UTC
Sorry for the typing mistake,
It should be /proc/net/dev instead of /proc/dev/net

Comment 2 faris xiao 2005-01-04 06:49:56 UTC
I meet the same bug.
ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0D:56:BC:4F:87  
          inet addr:211.136.83.81  Bcast:211.136.83.87  
Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10003778 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8998261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3753099706 (3579.2 Mb)  TX bytes:217130958 (207.0 
Mb)
          Interrupt:28 

eth0:0    Link encap:Ethernet  HWaddr 00:0D:56:BC:4F:87  
          inet addr:211.136.83.82  Bcast:211.136.83.255  
Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17298039 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16934925 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:195770904 (186.7 Mb)  TX bytes:3122619034 (2977.9 
Mb)
          Interrupt:28 

eth1      Link encap:Ethernet  HWaddr 00:0D:56:BC:4F:88  
          inet addr:192.168.0.6  Bcast:192.168.0.255  
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17298039 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16934925 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:195770904 (186.7 Mb)  TX bytes:3122619034 (2977.9 
Mb)
          Interrupt:29 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5231854 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5231854 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2254227813 (2149.7 Mb)  TX bytes:2254227813 
(2149.7 Mb)

 netstat -i
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-
DRP TX-OVR Flg
eth0       1500   0 10003957      0      0      0  8998429      
0      0      0 BMRU
eth0:0     1500   0 17298126      0      0      0 16935005      
0      0      0 BMRU
eth1       1500   0 17298126      0      0      0 16935005      
0      0      0 BMRU
lo        16436   0  5231903      0      0      0  5231903      
0      0      0 LRU


Comment 3 Karel Zak 2005-01-07 11:55:09 UTC
Created attachment 109461 [details]
the patch that fix alias statistics problem

Comment 4 Radek Vokál 2005-01-10 13:21:20 UTC
Thanks for the patch, it goes to net-tools-1.60-43 for FC. RHEL
version will follow.

Comment 6 Tim Powers 2005-05-19 18:48:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-445.html