Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235985 > unrolled thread

ifconfig <interface_name> stats ??? Wrong behavior OR BUG ?

Started byKanto Andria <avrkca@yahoo.ca>
First post2021-06-11 16:10 +0200
Last post2021-06-22 18:00 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.debian.user

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  ifconfig <interface_name> stats ??? Wrong behavior OR BUG ? Kanto Andria <avrkca@yahoo.ca> - 2021-06-11 16:10 +0200
    Re: ifconfig <interface_name> stats ??? Wrong behavior OR BUG ? Reco <recoverym4n@enotuniq.net> - 2021-06-11 16:20 +0200
    Re: ifconfig <interface_name> stats ??? Wrong behavior OR BUG ? Andy Smith <andy@strugglers.net> - 2021-06-11 16:30 +0200
    Re: ifconfig <interface_name> stats ??? Wrong behavior OR BUG ? David Wright <deblis@lionunicorn.co.uk> - 2021-06-22 18:00 +0200

#235985 — ifconfig <interface_name> stats ??? Wrong behavior OR BUG ?

FromKanto Andria <avrkca@yahoo.ca>
Date2021-06-11 16:10 +0200
Subjectifconfig <interface_name> stats ??? Wrong behavior OR BUG ?
Message-ID<CoQ1b-2a1-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hello,
First post here on this lists. I know about the the IP set of  commands, BUT my concern is about the ifconfig one.I have 2 Debian 10 Buster systems and I have the same behavior - reading the man page did not give the specific options 

      dada@Jradebian:~$ sudo ifconfig enp0s31f6                                                                                                                                    
[sudo] password for dada:                                                                                                                                                    
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                                                                              
        inet 192..168.0.187  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::9afa:9bff:fed8:9776  prefixlen 64  scopeid 0x20<link>
        ether 98:fa:9b:d8:97:76  txqueuelen 1000  (Ethernet)
        RX packets 128087  bytes 129259424 (123.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 60117  bytes 11913581 (11..3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xec200000-ec220000        
 Not sure here but the command sudo ifconfig <interface_name> STATS seems to reset the IP address 

                                                                        
dada@Jradebian:~$                                           
dada@Jradebian:~$                                     
dada@Jradebian:~$                                  
dada@Jradebian:~$ sudo ifconfig enp0s31f6 stats    
dada@Jradebian:~$                                                 
dada@Jradebian:~$                                      
dada@Jradebian:~$ sudo ifconfig enp0s31f6
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 54.36..162.17  netmask 255.0.0.0  broadcast 54.255.255.255
        inet6 fe80::9afa:9bff:fed8:9776  prefixlen 64  scopeid 0x20<link>
        ether 98:fa:9b:d8:97:76  txqueuelen 1000  (Ethernet)   
        RX packets 128151  bytes 129273250 (123.2 MiB)                   
        RX errors 0  dropped 0  overruns 0  frame 0         
        TX packets 60132  bytes 11918134 (11.3 MiB)   
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xec200000-ec220000
                                                             
I have experienced the same issue on a FreeBSD based product close to the 10.x release 

So the main question: Why the stats did not generate error like no such options ? Why the IP is reset to a public IP here belonging to OVH?
Best regards
Kanto

[toc] | [next] | [standalone]


#235986

FromReco <recoverym4n@enotuniq.net>
Date2021-06-11 16:20 +0200
Message-ID<CoQaT-2dL-35@gated-at.bofh.it>
In reply to#235985
	Hi.

On Fri, Jun 11, 2021 at 02:01:02PM +0000, Kanto Andria wrote:
> dada@Jradebian:~$ sudo ifconfig enp0s31f6 stats    

There's no "stats" option to ifconfig, at least according to the source
of version 1.60+git20180626.aebd88e.


But what a quick test does show me, is that in my environment "stats"
apparently interpreted as a hostname, which cannot be resolved:

$ /sbin/ifconfig eth0 stats
stats: Unknown host
ifconfig: `--help' gives usage information.


So what actually happened to you is that on your host "stats" was
resolved to 54.36.162.17, and then the resolved IP was set to your
interface with /8 netmask. Since the setting was successful (and why
would not it be, since you ran ifconfig as root) - you've got no error.


> I have experienced the same issue on a FreeBSD based product close to the 10.x release 

I'm unfamiliar with FreeBSD's ifconfig, and too lazy to dig their
sources. Probably the explanation is the same.

Reco

[toc] | [prev] | [next] | [standalone]


#235987

FromAndy Smith <andy@strugglers.net>
Date2021-06-11 16:30 +0200
Message-ID<CoQkx-2gK-3@gated-at.bofh.it>
In reply to#235985
Hi Kanto,

On Fri, Jun 11, 2021 at 02:01:02PM +0000, Kanto Andria wrote:
> dada@Jradebian:~$ sudo ifconfig enp0s31f6 stats    

You just resolved "stats" in DNS and set the IP address of interface
enp0s31f6 to that IP.

>         inet 54.36..162.17  netmask 255.0.0.0  broadcast 54.255.255.255

I'm guessing that due to your DNS configuration, partiocularly
search list, or any default answer your ISP provides, 54.36.162.17
came back as the answer to looking up "stats".

> So the main question: Why the stats did not generate error like no such options ?

There is no way to tell that you didn't mean to look up a name in
DNS.

> Why the IP is reset to a public IP here belonging to OVH?

That's what it resolved to.

This is not a bug.

The bigger issue here is that ifconfig has been deprecated for 10+
years and whatever you are trying to do with it you should be doing
with more modern commands, usually something out of the "iproute"
package, e.g. "ip".

What stats are you trying to view? Maybe "ip -s link"?

    https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf

may help.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

[toc] | [prev] | [next] | [standalone]


#236303

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2021-06-22 18:00 +0200
Message-ID<CsQYG-2Yz-1@gated-at.bofh.it>
In reply to#235985
On Fri 11 Jun 2021 at 14:01:02 (+0000), Kanto Andria wrote:

> First post here on this lists. I know about the the IP set of  commands, BUT my concern is about the ifconfig one.I have 2 Debian 10 Buster systems and I have the same behavior - reading the man page did not give the specific options 
> 
>       dada@Jradebian:~$ sudo ifconfig enp0s31f6
> 
> So the main question: Why the stats did not generate error like no such options ? Why the IP is reset to a public IP here belonging to OVH?

Others have answered the technical issues.

If you just want to run ifconfig because its output pleases the eye
(perfectly reasonable if you been using it for years), you can just
run it as a user, not root. Type, say,

$ /sbin/ifconfig -a

to display all interfaces. That way, you shouldn't be able to disturb
your networking by reconfiguring it accidentally.

If you *want* to configure it, use ip instead. Most people will not be
willing to help with ifconfig any more. It's obsolescent, and doesn't
handle a lot of modern configuration options.

Cheers,
David.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web