LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-10-2012, 02:26 PM   #1
redhat70
Member
 
Registered: May 2012
Posts: 86

Rep: Reputation: Disabled
ifconfig -a Command, need help on output.....


Hi,

# ifconfig -a

Output :
=======

eth0 Link encap:Ethernet HWaddr E4:1F:13:30:27:04
inet addr:192.168.150.4 Bcast:192.168.150.255 Mask:255.255.255.0
inet6 addr: fe80::e61f:13ff:fe30:2704/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14056743 errors:0 dropped:0 overruns:0 frame:0
TX packets:6088914 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2148615215 (2.0 GiB) TX bytes:603297116 (575.3 MiB)
Interrupt:169 Memory:92000000-92012100

eth1 Link encap:Ethernet HWaddr E4:1F:13:30:27:06
inet addr:192.168.152.2 Bcast:192.168.152.127 Mask:255.255.255.128
inet6 addr: fe80::e61f:13ff:fe30:2706/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8994137 errors:0 dropped:0 overruns:0 frame:0
TX packets:8714781 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:584049190 (556.9 MiB) TX bytes:677753107 (646.3 MiB)
Interrupt:202 Memory:94000000-94012100

eth1:2 Link encap:Ethernet HWaddr E4:1F:13:30:27:06
inet addr:192.168.152.82 Bcast:192.168.152.127 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:202 Memory:94000000-94012100


My question is :
==================

Q.1) what is the difference between eth1 and eth1:2 ?

Q.2) Is their any other command which can display the interfaces etho,eth1,eth2 etc....in Single along with their IPs instead of the above full output ?

I mean instead of :

Link encap:Ethernet HWaddr E4:1F:13:30:27:06
inet addr:192.168.152.82 Bcast:192.168.152.127 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:202 Memory:94000000-94012100

I want the output as :

etho : 192.168.150.4

eth 1 : 192.168.152.2

eth1:2 : 192.168.152.82








Regards,
Aparna.

Last edited by redhat70; 10-10-2012 at 02:28 PM.
 
Old 10-11-2012, 02:23 AM   #2
kamran.ayub
Member
 
Registered: Jan 2012
Posts: 72

Rep: Reputation: Disabled
use grep for desired string match

For such bried needful information you may search your desired strings as following :

ifconfig -a | grep 'eth\|inet'

eth0 Link encap:Ethernet HWaddr 00:50:56:B6:35:98
inet addr:192.168.200.147 Bcast:192.168.200.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:feb6:3563/64 Scope:Link


so its just a handy info for you as required.
 
Old 10-11-2012, 03:11 AM   #3
henrycoffin
Member
 
Registered: Dec 2006
Distribution: RHEL Debian
Posts: 42

Rep: Reputation: 15
eth1:2 is a secondary IP on the same NIC
 
Old 10-11-2012, 03:59 AM   #4
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
use this command

Code:
/sbin/ifconfig | cut -d " " -f1,12,16 | grep -A 1 eth | tr -d - | tr -s "\n" |sed -e :a -e N -e 's/\n/ /'
copy and paste

cheers
 
Old 10-11-2012, 06:24 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Re 1:
A single physical interface (NIC) eg eth0 can have multiple virtual interfaces assigned to it (aka 'vif's)

A single usually looks like eth0, eth1 etc.
vif's append':x' where x is another num hence eth1:2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What does this ifconfig output mean? rylan76 Linux - Newbie 2 05-15-2009 06:13 AM
[ask] ifconfig output reverse demhyt Linux - Networking 4 09-21-2008 07:06 PM
Output of the ifconfig command isra Linux - General 8 03-20-2007 11:13 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
ifconfig output alaios Linux - Networking 8 12-02-2004 02:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration