lkml.org 
[lkml]   [1999]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject2.0.37 - ip_accounting strangeness
Hi,

I have the following configuration:

My workstation (2.0.37) kernel has the following ifconfig output:

eth0 Link encap:Ethernet HWaddr 00:60:08:2D:16:EE
inet addr:192.168.172.2 Bcast:192.168.172.15 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4838950 errors:0 dropped:0 overruns:0 frame:0
TX packets:2593158 errors:0 dropped:0 overruns:0 carrier:0
collisions:4286
Interrupt:9 Base address:0xe000

eth0:1 Link encap:Ethernet HWaddr 00:60:08:2D:16:EE
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0

netstat says:

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.2 0.0.0.0 255.255.255.255 UH 1500 0 0 eth0:1
192.168.172.0 0.0.0.0 255.255.255.240 U 1500 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 1500 0 0 eth0:1
127.0.0.0 0.0.0.0 255.0.0.0 U 3584 0 0 lo
0.0.0.0 192.168.172.14 0.0.0.0 UG 1500 0 0 eth0


There is a second machine on the LAN which is similar except that it
uses the .1 addresses (192.168.172.1 and 192.168.2.1)

I added accounting rules on my workstation:

/sbin/ipfwadm -i -A in -W eth0
/sbin/ipfwadm -i -A out -W eth0
/sbin/ipfwadm -i -A in -W eth0:1
/sbin/ipfwadm -i -A out -W eth0:1
/sbin/ipfwadm -i -A in -W lo
/sbin/ipfwadm -i -A out -W lo

Which show up nicely:

ipfwadm -A -l -e -x
IP accounting rules
pkts bytes dir prot opt ifname ifaddress source destination ports
5777 1000860 out all ---- lo any anywhere anywhere n/a
5785 1001672 in all ---- lo any anywhere anywhere n/a
0 0 out all ---- eth0:1 any anywhere anywhere n/a
0 0 in all ---- eth0:1 any anywhere anywhere n/a
147 8364 out all ---- eth0 any anywhere anywhere n/a
156 9896 in all ---- eth0 any anywhere anywhere n/a

but if I ping 192.168.2.1 :

ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: icmp_seq=0 ttl=64 time=0.5 ms
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=0.2 ms
64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=0.2 ms

ipfwadm -A -l -e -x
IP accounting rules
pkts bytes dir prot opt ifname ifaddress source destination ports
12020 2095024 out all ---- lo any anywhere anywhere n/a
12028 2095836 in all ---- lo any anywhere anywhere n/a
6 474 out all ---- eth0:1 any anywhere anywhere n/a
0 0 in all ---- eth0:1 any anywhere anywhere n/a
232 14464 out all ---- eth0 any anywhere anywhere n/a
250 16924 in all ---- eth0 any anywhere anywhere n/a

...then the packets seem to go out on the eth0:1 interface but return
on the eth0 interface?

The /proc/net/dev output seems to disagree:

cat /proc/net/dev ; ping -c 10 192.168.2.1 ; cat /proc/net/dev

Inter-| Receive | Transmit
face |packets errs drop fifo frame|packets errs drop fifo colls carrier
lo:173759223 0 0 0 0 173759223 0 0 0 0 0
eth0:4841212 0 0 0 0 2595134 0 0 0 4286 0
eth0:1: 113605 0 0 0 0 100591 0 0 0 0 0

PING 192.168.2.1 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: icmp_seq=0 ttl=64 time=0.4 ms
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=0.3 ms
64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=0.2 ms
64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=0.2 ms
64 bytes from 192.168.2.1: icmp_seq=8 ttl=64 time=0.2 ms
64 bytes from 192.168.2.1: icmp_seq=9 ttl=64 time=0.3 ms

--- 192.168.2.1 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max = 0.2/0.2/0.4 ms

Inter-| Receive | Transmit
face |packets errs drop fifo frame|packets errs drop fifo colls carrier
lo:173761110 0 0 0 0 173761110 0 0 0 0 0
eth0:4841230 0 0 0 0 2595147 0 0 0 4286 0
eth0:1: 113615 0 0 0 0 100601 0 0 0 0 0

-> Packet Counter for eth0:1 increased by 10 packets in and out.

BTW: net-tools 1.46 seems to have trouble parsing the interface-stats:

cat /proc/net/dev
Inter-| Receive | Transmit
face |packets errs drop fifo frame|packets errs drop fifo colls carrier
lo:173722548 0 0 0 0 173722548 0 0 0 0 0
eth0:4840494 0 0 0 0 2594557 0 0 0 4286 0
eth0:1: 113592 0 0 0 0 100578 0 0 0 0 0

but ifconfig eth0:1 says

% ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:60:08:2D:16:EE
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0

is this intended, an accident or a bug?

Kind regards
Henning


--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen -- hps@tanstaafl.de
TANSTAAFL! Consulting - Unix, Internet, Security

Hutweide 15 Fon.: 09131 / 50654-0 "There ain't no such
D-91054 Buckenhof Fax.: 09131 / 50654-20 thing as a free Linux"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.040 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site