
8th January 2007, 22:34
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|

9th January 2007, 15:53
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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.
|

10th January 2007, 23:43
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

10th January 2007, 23:52
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
And, I am having spaces, as you had mentioned, not sure why those are not being displayed here.
|

11th January 2007, 16:21
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

11th January 2007, 17:01
|
|
Senior Member
|
|
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 16 Times in 15 Posts
|
|
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?
|

11th January 2007, 18:42
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

11th January 2007, 19:59
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
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
?
|

11th January 2007, 20:49
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

11th January 2007, 22:03
|
|
Junior Member
|
|
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 13:26.
|
|
Recent comments
13 hours 33 min ago
13 hours 39 min ago
18 hours 37 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 3 hours ago
1 day 7 hours ago
1 day 14 hours ago
1 day 18 hours ago
1 day 19 hours ago