LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-12-2015, 10:41 PM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Problem to get IP


Hi,
How to resolve this problem?

[root@CentOS65x64 ~]# ifconfig eth0 | grep inet | awk '{ print $2 }'
eth0: error fetching interface information: Device not found
 
Old 05-12-2015, 11:18 PM   #2
mralk3
Senior Member
 
Registered: May 2015
Location: Utah, USA
Distribution: Slackware
Posts: 1,391

Rep: Reputation: 770Reputation: 770Reputation: 770Reputation: 770Reputation: 770Reputation: 770Reputation: 770
The error is self explanatory. eth0 does not exist. Run ifconfig without any argument or pipes. You will then see what network interfaces exist.

Edit-

Try running the following instead:

[~]$ sudo ifconfig | grep inet | awk '{ print $2 }' | sed '/127.0.0.1/d' | sed 's/addr://g'

192.168.1.136

Last edited by mralk3; 05-13-2015 at 01:04 AM.
 
Old 05-12-2015, 11:57 PM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You may use dhcp client to automatically set up net if a router is connected to your box.
 
Old 05-13-2015, 09:32 AM   #4
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Thanks all.

Mralk,
Are you putting one IP to the OS?
 
Old 05-13-2015, 11:47 AM   #5
mralk3
Senior Member
 
Registered: May 2015
Location: Utah, USA
Distribution: Slackware
Posts: 1,391

Rep: Reputation: 770Reputation: 770Reputation: 770Reputation: 770Reputation: 770Reputation: 770Reputation: 770
Quote:
Originally Posted by Huamin View Post
Thanks all.

Mralk,
Are you putting one IP to the OS?
Yes, I have only one ip address on my system. It is a laptop on wifi.
 
  


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
Do I have a path problem, an Apache2 problem or a Javascript problem or any other pro rblampain Linux - Networking 0 12-29-2010 04:50 AM
[SOLVED] Problem booting generic kernel and another problem with fluxbox - libpng warning Switch7 Slackware 17 11-14-2009 04:36 AM
Sound Card problem(every time i install linux i have diffirent hardware problem) jacka1l Linux - Newbie 7 08-11-2005 07:10 AM
Lan configuration problem - NFS boot problem - RX&TX packets errors 242VDM242 Linux - Networking 4 11-25-2004 02:35 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:03 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration