Thursday, May 9, 2013

List all ip addresses on a linux system

With the ifconfig command you can list all network cards and ip addresses on a linux system.

#ifconfig

eth0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
  inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
  inet6 addr: 0000::000:0000:0000:000/00 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:54367 errors:0 dropped:0 overruns:0 frame:0
  TX packets:34504 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:247741252 (247.7 MB)  TX bytes:127569007 (127.5 MB)
  Interrupt:28 Base address:0x0000

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:2394 errors:0 dropped:0 overruns:0 frame:0
  TX packets:2394 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:178041 (173.6 KiB)  TX bytes:178041 (173.6 KiB)

eth0 is my network card and because i m behind a router, my private ip address is: 192.168.1.2.
lo is the loopback address.

No comments:

Post a Comment