Linux Today: Linux News On Internet Time.

O'Reilly Network: Exploring the /proc/net/ Directory

Nov 23, 2000, 16:05 (0 Talkback[s])
(Other stories by Terry Dawson)

"The /proc/ filesystem is a trick the Linux kernel uses to make certain internal information available to user-space processes. The kernel presents the information in virtual files in virtual directories. The files and directories of the /proc/ filesystems are virtual because the data is not actually stored on any sort of permanent storage like a hard disk; instead, the directories, files, and data within them are created dynamically in memory from raw kernel data whenever you attempt to read from them. A variety of network information and data is available in the /proc/net/ directory. In this column we'll take a look at some of the more useful files available in the /proc/net/ subdirectory and how you might use them in administration of your network."

"All Linux distributions automatically mount the /proc/ filesystem at boot time. It's not essential that this be done, but a number of programs rely on it, so it's wise. To see if the /proc filesystem is mounted on your machine, use the mount command without any arguments."

"When the /proc/ filesystem is mounted, you can treat it as though it were a real filesystem containing directories and files. If you move to the /proc/net/ directory and list the files it contains, you will see a list that looks somewhat like the following:

arp           ip_fwnames    route      udp
dev           ip_mr_cache   rpc/       unix
dev_mcast     ip_mr_vif     rt_cache  
dev_stat      netlink       snmp
igmp          netstat       sockstat
ip_fwchains   raw           tcp
The actual list of files will vary a little depending on what version kernel you are running and what networking options you've compiled into it."

Complete Story

Related Stories: