Linux ifconfig If you do not take any parameters, it will output the current network interface;
- [root@localhost ~]# Linux ifconfig
- eth0 Link encap:Ethernet HWaddr 00:C0:9F:94:78:0E
- inet addr:192.168.1.88 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::2c0:9fff:fe94:780e/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:850 errors:0 dropped:0 overruns:0 frame:0
- TX packets:628 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:369135 (360.4 KiB) TX bytes:75945 (74.1 KiB)
10. Interrupt:10 Base address:0x3000
- 11.
12. lo Link encap:Local Loopback
13. inet addr:127.0.0.1 Mask:255.0.0.0
14. inet6 addr: ::1/128 Scope:Host
15. UP LOOPBACK RUNNING MTU:16436 Metric:1
16. RX packets:57 errors:0 dropped:0 overruns:0 frame:0
17. TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
18. collisions:0 txqueuelen:0
19. RX bytes:8121 (7.9 KiB) TX bytes:8121 (7.9 KiB)
Commentary: eth0 represents a card, wherein a physical address indicating HWaddr card, we can see the current physical address of the card (MAC address) is 00: C0: 9F: 94: 78: 0E; inet addr card used to represent IP address, IP address, this card is 192.168.1.88, broadcast address, Bcast: 192.168.1.255, mask address mask: 255.255.255.0
lo is a bad return address of the host, which generally is used to test a web application, but do not want the user LAN or outside the network to view, and the view can only run on which network interfaces on this host. For example, we specify HTTPD server back to the bad address, will be able to see what you stand WEB site in browser and enter 127.0.0.1. But only you can see, the host or other LAN users do not know;
If we want to know the host of all network interfaces, use the following command; [root @ localhost ~] # Linux ifconfig -a If we want to see a port, such as eth0 we would like to see the state, you can use the following method ; [root @ localhost ~] # Linux ifconfig eth0