LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2010, 12:42 AM   #1
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
ifup -a not working


Hello

So I thought I was getting the hang of networking stuff, but, apparently not. Anyhoo, I have a startup script (very basic one liner)

ifup -a

Reading the man page for ifup it says this should bring up all devices listed in interfaces file (so contained in there I have):

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

After starting my machine I run ifconfig which returns no output.
If I do ifup eth0 I get: ifup: interface eth0 already configured

So finally, if I run dhcpcd this brings up my nic. If I then do ifdown -a and kill the dhcpcd process and then manually type ifup -a, it all magically comes back.

Would someone explain what step I am missing in the process to have all my cards startup as part of the boot process?

Cheers
Grail

PS. Let me know if anymore details are required?
 
Old 03-01-2010, 10:04 AM   #2
dtlp
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
what's the output of your /etc/sysconfig/network-scripts/ifcfg-eth0 ?

ONBOOT=yes should be set.
 
Old 03-02-2010, 12:16 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Original Poster
Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Hmmmm ... I do not have this file nor entry at all, but I have also found that after machine has booted
if I simply run ifup -a at the command line that nothing starts up either

So the file you have listed may / mat not be needed but I obviously have another underlying issue
 
Old 03-02-2010, 12:28 AM   #4
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 863

Rep: Reputation: 45
Wrong Program?

ifup is an executable program, not a script. On my Debian system it is /sbin/ifup.

Have you replaced this by your own script?
 
Old 03-02-2010, 12:40 AM   #5
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Rep: Reputation: 55
Hi Grail,

Quote:
Originally Posted by grail View Post
Hmmmm ... I do not have this file nor entry at all,(
It seems you are using Ububtu, mostly you have to search for /etc/network/interfaces/ifcfg-eth0.

If you are getting IP, Netmask, DNS entries from DHCP server then contents of /etc/network/interfaces/ifcfg-eth0 should be similar to
Code:
DEVICE=eht0
TYPE=ethernet
BOOTPROTO=dchp
ONBOOT=yes
Now you can restart your network
Code:
# /sbin/services network restart
Then check
Code:
# /sbin/ifconfig
If the issue persists please paste the output of above commands.

Last edited by vinaytp; 03-02-2010 at 12:43 AM.
 
Old 03-02-2010, 01:12 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
It seems all the advice (except #4) you have received so far is from people who are unfamiliar with Debian style networking. Your /etc/network/interfaces file seems to be ok. I suspect the problem is that the device is not seen. Can you please post the output of:

Code:
ifconfig -a
lspci | grep -i ether
uname -a
cat /etc/debian_version
Cheers,

Evo2.

Last edited by evo2; 03-02-2010 at 01:14 AM.
 
Old 03-02-2010, 02:32 AM   #7
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Maybe one should see what the situation is before and after the ifup -a in your script. Specially during boot things change very frequently as drivers getting loaded, daemons getting started and alike. So maybe just put a little script like this in front and after ifup -a


Code:
cat << EOF
#!/bin/bash
FIX=$1
/sbin/ip link > ipl.$FIX
/sbin/ip addr > ipl.$FIX
/sbin/lspci > ipl.$FIX
/sbinlsmod > ipl.$FIX
EOF > status
chmod a+x ./status
(Dunno if the pathes are right. just make sure they are absolute)


Then change your script to something like this

Code:
status before
ifup -a
status after
P.S. I just saw that you are using ifconfig so justs replace ip with the appropiate ifconfig lines.
 
Old 03-02-2010, 09:11 PM   #8
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Original Poster
Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Ok ... thanks all for the replies.

1. I have not replaced the ifup executable, it is the one line in my bootup script
2. The system I am running into this issue on is not my Ubuntu system, but a source based distro of my own making (very early stages)

3. ifconfig -a yields:
Code:
eth0      Link encap:Ethernet  HWaddr 08:00:27:AE:BE:C5  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
lspic | grep -i ether:

Code:
 00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
uname -a:

Code:
 Linux ripclaw 2.6.27.10-SMGL-iso #1 Mon Feb 2 18:34:19 UTC 2009 i686 GNU/Linux
And as you can see from last entry, the cat is not an option as not debian.

All of the above is after a fresh install.

4. Will post output from script by zhjim if still required

Cheers Grail
 
Old 03-02-2010, 09:14 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Does the following bring the interface up:

Code:
ifup eth0
If not the problem may be that you need to bring it down first (I know it is not really up)
Code:
ifdown eth0
ifup eth0
Evo2.

Last edited by evo2; 03-02-2010 at 09:15 PM.
 
Old 03-02-2010, 09:18 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
I just reread you post #8. Regarding 2.
Are you using upstream sources and designing your networking in a similar fashion to Debian or are you actually using Debian sources?

Evo2.
 
Old 03-03-2010, 12:18 AM   #11
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Original Poster
Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Code:
 ifup eth0
ifup: interface eth0 already configured

ifdown eth0
dhcpcd: dhcpcd not running

ifup eth0
e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
dhcpcd: version 5.0.9 starting
dhcpcd: eth0: rebinding lease of 10.0.2.15
dhcpcd: eth0: acknowledged 10.0.2.15 from 10.0.2.2
dhcpcd: eth0: checking for 10.0.2.15
dhcpcd: eth0: leased 10.0.2.15 for 86400 seconds
dhcpcd: forking to background
And so now it is up??? So why does it have to go down first?

Yes to upstream sources.
 
Old 03-03-2010, 12:41 AM   #12
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
ifup tries to keep track of the whether the interface is up or down using the file /etc/network/run/ifstate
Sometimes this can get out of sync with the true state of the device. In such a case you can use "ifdown eth0" to get the ifstate file back in sync, or you can use the --force option to ignore the ifstate file. All of this is documented in the man page.

Cheers,

Evo2.

Last edited by evo2; 03-03-2010 at 12:42 AM.
 
  


Reply



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
Broadcom working with native support (bcm43xx on FC6)! Now... question about ifup... jacksmash Linux - Hardware 3 02-27-2007 09:16 AM
ifup?? yenonn Linux - Networking 9 11-16-2005 07:41 PM
resolv.conf ifup dhcpcd not working together andrewguy9 Linux - Wireless Networking 1 03-19-2005 02:43 PM
WEP, ifup not working FC3 w/ WMP54GS teelr Linux - Wireless Networking 0 01-18-2005 09:57 AM
where is my ifup/down? syreth Slackware 4 09-13-2004 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:46 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
Open Source Consulting | Domain Registration