Linux: Find out Ethernet card driver name

Posted on in Categories , , , , , , , last updated September 7, 2007

Under Linux, you use term called modules for device drivers. The driver can be loaded or unloaded as per your requirement using commands. Each driver or module gives the Linux information on how to control that particular Ethernet card. The name of each module (driver) is listed in the /etc/modules.conf file.

Command to find out Ethernet card driver name

You can try any one of the following command to find out your Ethernet card driver:

# dmesg | grep 'Ethernet driver'

Output:

8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)

Or search a file called /var/log/dmesg:

# grep 'Ethernet driver' /var/log/dmesg

Output:

8139too Fast Ethernet driver 0.9.27
8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)

You can also get driver name from config file:

# grep eth0 /etc/modules.conf

Output:

alias eth0 8139too

OR

# vi /etc/modules.conf

Search for eth0 string.

In above example 8139too is driver loaded for eth0. You can find out more information about this driver using modinfo command:

# modinfo 8139too

modinfo program to show information about a Linux Kernel module. You can also find out all loaded modules or drivers using lsmod command:

# lsmod | less

lsmod is a program to show the status of modules in the Linux Kernel.

See also:

Linux / UNIX find out what other users are doing?

Posted on in Categories , , , , , , last updated October 2, 2007

Q. Can you explain the command to find what users are doing on my UNIX / Linux system?

A. Both Linux and UNIX (FreeBSD/Solaris) has w command to show who is logged on and what they are doing.

The w command prints a summary of the current activity on the system, including what each user is doing.

=> The first line displays the current time of day

=> How long the system has been running

=> The number of users logged into the system

=> The load averages. The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.

You can also use ps command which shows you process that are running on the system.

Type w command displays information about the users currently on the machine, and their processes.

Show who is logged on and what they are doing with w command

The fields output are the user’s login name, the name of the terminal the user is on, the host from which the user is logged in, the time the user logged on, the time since the user last typed anything, and the name and arguments of the current process.
$ w
Output:

radm    pS 66.90.90.102     Sun01PM  1day -bash
raj     pW 192.168.1.100.  7:42AM     5 ssh [email protected]
miku    pX a80-186-82-84.el  7:28AM    10 screen irssi
vivek   pY 196.15.193.111    4:11AM     0 nano -w hireme
rani    q0 dslbr0.bsnl.in    7:32AM    12 lynx http://slashdot.org/
jadmin  q2 dslbr5.bsnl.in    7:33AM     0 ssh [email protected]
gad     q3 dslbr76.bsnl.in   7:40AM     0 -ksh
bencs   q5 dslbr22.bsnl.in   7:44AM     5 -zsh
vivek   q6 gw11-vsnl.in      7:47AM    11 -bash

You can use the ps command shows you processes that are running on the system:

$ ps -au | more
$ ps -au | less

So you can use both w and ps commands to find out who’s doing what.

How do I find out the MAC address of my Linux or FreeBSD system?

Posted on in Categories , , , , , last updated January 18, 2008

Q. Can you tell me how can I find out MAC address under Linux or FreeBSD server?

A. A mac address is acronym for media access control address, is a unique address assigned to almost all-networking hardware such as Ethernet cards, router etc. Most layer 2 network protocols use one of three numbering spaces managed by the IEEE: MAC-48, EUI-48, and EUI-64, which are designed to be globally unique. (see mac address at wikipedia for more information).

Following command work with Linux and other UNIX oses:

ifconfig command

Ifconfig is used to configure the kernel-resident network interfaces.

In order to find out MAC address of system you can use ifconfig command as follows:
$ /sbin/ifconfig | grep HWaddr
Output:

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07

OR

$ /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
        inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
        inet6 addr: fe80::20f:eaff:fe91:407/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
        RX packets:60400 errors:0 dropped:0 overruns:0 frame:0
        TX packets:109216 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:69273219 (66.0 MiB)  TX bytes:14285799 (13.6 MiB)
        Interrupt:18 Base address:0xc000

lo        Link encap:Local Loopback
        inet addr:127.0.0.1  Mask:255.0.0.0
        inet6 addr: ::1/128 Scope:Host
        UP LOOPBACK RUNNING  MTU:16436  Metric:1
        RX packets:3869 errors:0 dropped:0 overruns:0 frame:0
        TX packets:3869 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:0
        RX bytes:396498 (387.2 KiB)  TX bytes:396498 (387.2 KiB)

OR as a root user type following command:

# grep eth0 /var/log/dmesg
eth0: RealTek RTL8139 at 0xc000, 00:0f:ea:91:04:07, IRQ 18
eth0:  Identified 8139 chip type 'RTL-8100B/8139D'
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

FreeBSD example

# ifconfig
Output:

lnc0: flags=108843 mtu 1500
        inet 74.xx.yy.zzz netmask 0xfffffff0 broadcast 74.xx.yyy.zzz
        ether 00:0c:29:b8:92:8b
plip0: flags=108810 mtu 1500
lo0: flags=8049 mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000

See also: