[Redirected to -net]

On Tue, Oct 02, 2001 at 02:53:04PM -0400, [EMAIL PROTECTED] wrote:
> I installed the new release 4.4 on one machine to check out a feature I have been 
>waiting for. 
> That is the ability to track bytes through one interface using several IP numbers. I 
>seem to have
> missed something I hope someone out there could help with. It appears to track 
>incomming but not
> outgoing bytes.
> 
> When you do a 'netstat -bin' you get a report like:
> netstat -bin
> Name  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs   
>  Obytes  Coll
> rl0   1500  <Link#1>    00:48:54:1e:b9:38    13072     0    5142645    13636     0   
> 1345022     0
> rl0   1500  10/24         10.0.0.170          3984     -    4521604    13588     -   
> 1152144     -
> rl0   1500  10.0.0.171/32 10.0.0.171           223     -      12331        0     -   
>       0     -
> rl0   1500  10.0.0.172/32 10.0.0.172           241     -      14334        0     -   
>       0     -
> rl0   1500  10.0.0.173/32 10.0.0.173          8403     -     355006        0     -   
>       0     -
> rl0   1500  10.0.0.174/32 10.0.0.174             0     -          0        0     -   
>       0     -
> rl0   1500  10.0.0.175/32 10.0.0.175           315     -      16779        0     -   
>       0     -
> rl1*  1500  <Link#2>    00:50:bf:16:15:50        0     0          0        0     0   
>       0     0
> rl2*  1500  <Link#3>    00:50:bf:16:15:5f        0     0          0        0     0   
>       0     0
> rl3*  1500  <Link#4>    00:48:54:1e:b7:81        0     0          0        0     0   
>       0     0
> rl4*  1500  <Link#5>    00:50:ba:42:7f:be        0     0          0        0     0   
>       0     0
> lp0*  1500  <Link#6>                             0     0          0        0     0   
>       0     0
> lo0   16384 <Link#7>                             4     0        187        4     0   
>     187     0
> lo0   16384 127           127.0.0.1              4     -        187        4     -   
>     187     -
> ppp0* 1500  <Link#8>                             0     0          0        0     0   
>       0     0
> sl0*  552   <Link#9>                             0     0          0        0     0   
>       0     0
> 
> It is not counting the Outgoing packets or bytes on any /32 ip.
> 
> I added the following to rc.conf which appeared to be what to do from
> 
>http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-virtual-hosts.html
> 
> ifconfig_rl0="inet 10.0.0.170 netmask 255.255.255.0"
> ifconfig_rl0_alias0="inet 10.0.0.171 netmask 255.255.255.255"
> ifconfig_rl0_alias1="inet 10.0.0.172 netmask 255.255.255.255"
> ifconfig_rl0_alias2="inet 10.0.0.173 netmask 255.255.255.255"
> ifconfig_rl0_alias3="inet 10.0.0.174 netmask 255.255.255.255"
> ifconfig_rl0_alias4="inet 10.0.0.175 netmask 255.255.255.255"
> 
> Everything else seems to be fine it is just not counting the outgoing packets
> or bytes. Would some tell me what I missed?
> 
It counts them, but not for the IP address in the IP datagram itself,
but rather for IP address on an interfaces recorded with the corresponding
route.  For example,

# ifconfig rl0 inet
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.4.115 netmask 0xffffff00 broadcast 192.168.4.255
        inet 192.168.4.200 netmask 0xffffff00 broadcast 192.168.4.255
# route -vn get 192.168.4.65
[...]
sockaddrs: <DST,GATEWAY,IFP,IFA>
 192.168.4.65 0.d0.b7.16.9c.c6 rl0:0.c0.df.3.2d.79 192.168.4.115
                                                   ^^^^^^^^^^^^^

The both `ping -S 192.168.4.115 192.168.4.65' and
`ping -S 192.168.4.200 192.168.4.65' will count them for 192.168.4.115.

If you change your route like this:

# route change 192.168.4.65 -ifa 192.168.4.200
# route -vn get 192.168.4.65
[...]
sockaddrs: <DST,GATEWAY,IFP,IFA>
 192.168.4.65 0.d0.b7.16.9c.c6 rl0:0.c0.df.3.2d.79 192.168.4.200

both pings will be counted for 192.168.4.200.

The behavior becomes more clear when you consider the case of
raw IP packet (which can have an arbitrarily source IP address),
or the gateway host forwarding a packet from the attached
network.  I agree this is confusing.


Cheers,
-- 
Ruslan Ermilov          Oracle Developer/DBA,
[EMAIL PROTECTED]           Sunbay Software AG,
[EMAIL PROTECTED]          FreeBSD committer,
+380.652.512.251        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to