Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th January 2007, 22:34
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Debian-Sarge : Not picking up the IP address on reboot

Hi,
I am running Debian Sarge. I have made changes to /etc/network/interfaces file so that it should pick the static IP address I am assigning. So my file looks like:

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
auto eth0
iface eth0 inet static
address 192.168.XX.ABC
netmask 255.255.255.0
gateway 192.168.XX.Z


But whenever I reboot my system, it doesn't take this IP address, and shows something like 10.0.X.X. I have to again run "ifdown eth0" and "ifup eth0" to get the required IP assigned.

What should I do so that it keeps the desired IP even after reboot. This may not be the right file where I need to set the static IP address. I need some help as I am pretty new to Debian.

Thanks Guys!
Reply With Quote
Sponsored Links
  #2  
Old 9th January 2007, 15:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

The file must look like this:

Code:
# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
(use your own IP addresses). The leading spaces are important.

Also, make sure you use Unix linebreaks in the file when you save it.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 10th January 2007, 23:43
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

Nope, that didn't work.

I had modified the file as you had specified and my file now looks like:


# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
auto eth0
iface eth0 inet static
address 192.168.0.179
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1



When I rebooted the machine, it came up with 10.0.0.149 and with odd BCast & Mask value as well.

Looking around for help.
Reply With Quote
  #4  
Old 10th January 2007, 23:52
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And, I am having spaces, as you had mentioned, not sure why those are not being displayed here.
Reply With Quote
  #5  
Old 11th January 2007, 16:21
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

Other thing is that, after I reboot, if I type ifdown eth0, it gives me a message:

SIOCDELERT: no such process

And after that I have to do ifup eth0 to take it my intended IP which I am mentioning in interfaces file.

Any suggestions what to look for ? Is it that eth0 is not coming up on it's own ?

A snippet of ifconfig for eth0

inet addr:10.0.0.149 Bcast:10.255.255.255 Mask:255.0.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1471 errors:0 dropped:0 overruns:0 frame:0
TX packets:254 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:190424 (185.9 KiB) TX bytes:19553 (19.0 KiB)
Interrupt:177 Base address:0xb400
Reply With Quote
  #6  
Old 11th January 2007, 17:01
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

This is really funny. The ifconfig shows you have IP address 10.0.0.149 assigned, but yet your config indicates it should be 192.168.0.179.

Are you maybe playing with Virtual Machines?
Reply With Quote
  #7  
Old 11th January 2007, 18:42
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the virtual machine setup as well on this system. Though don't know how that's been setup as it was already there and I am handling an old system.

Almost same thing happens with virtual machin, wheevr I bring that up using VMWare, it somehow goes back to some old IP which I have to reset again.


Just to mention that above ifconfig output was taken before doing ifdown eth0 and ifconfig eth1.

After doing ifup eth0, ifconfig shows me the correct intended IP address.
Reply With Quote
  #8  
Old 11th January 2007, 19:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Quote:
Originally Posted by contactme
And, I am having spaces, as you had mentioned, not sure why those are not being displayed here.
Because you didn't mark it as code here.

What's the output of
Code:
ls -la /etc/network
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 11th January 2007, 20:49
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Guys,
Finally figured this out.

That script/configuration file is being run from /etc/rcS.d directory. and when I commented that line, my system came back with the correct IP :-D

One problem resolved. though I'm still need to find out why that's there and how it's been used to setup VLANs.


thanks guys
Reply With Quote
  #10  
Old 11th January 2007, 22:03
contactme contactme is offline
Junior Member
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
 
Cool

The above comment was related to :

"I have found one configuration file which has

ifconfig eth0 10.0.0.149 up


But still trying to find out from where it's being read ? " and finally I figured that out in /etc/rcS.d directory.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Perfect Xen 3.0.3 Setup For Debian Sarge iptables problem on dom0 ren22 HOWTO-Related Questions 21 7th January 2007 19:32
Debian Sarge power down by itself jfer Technical 1 24th March 2006 20:08
Difference between Debian Sarge kernel update -> 64 bit & Debian Unofficial AMD64 ver Hans Installation/Configuration 2 2nd March 2006 23:41
e-mail problem!!! Debian 3.1 maroonworks Installation/Configuration 18 6th December 2005 14:42
Debian Sarge RAID5 killfrog Installation/Configuration 2 23rd October 2005 21:43


All times are GMT +2. The time now is 04:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.