Using one or two command line, how do we know a particular
network interface (e.g eth0) is connecting using
can we do this using similar commands like
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
Examine processor status for a process by the name dhclient. Usually its pid will be listed under /run/dhclient..pid.
This process will not be run on statically configured addressed interfaces
Example: On a DHCP addressed eth0 RPi.
root 1711 1 0 07:58 ? 00:00:00 dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
root@homerpi:/# ls -l /run/dhclient.eth0.pid -rw-r--r-- 1 root root 5 Nov 19 07:58 /run/dhclient.eth0.pid
Or as suggested earlier, examine the /etc/network/interfaces for its ip address assignment mode
You could try /usr/bin/awk '/eth0/' /etc/network/interfaces