LinuxQuestions.org
Review your favorite Linux distribution.
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 01-15-2014, 08:48 PM   #1
yoda987
LQ Newbie
 
Registered: Mar 2011
Location: NC
Distribution: CentOS
Posts: 19

Rep: Reputation: 0
Static IP not working


Someone tell me what Im doing wrong here. Ive set a static IP on this box with following config:

nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address 172.18.240.25
netmask 255.255.255.0
gateway 172.18.240.1

Then

service networking restart

Then run

update-rc.d networking defaults

Which generates the following:

update-rc.d: warning: networking start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (none)
update-rc.d: warning: networking stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6)
System start/stop links for /etc/init.d/networking already exist.

Any time I reboot it, it pulls a new DHCP address until I restart networking again.
 
Old 01-15-2014, 09:36 PM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,347

Rep: Reputation: 227Reputation: 227Reputation: 227
can you post the DHCP address generated?

Your network has multiple subnets?
 
Old 01-15-2014, 09:47 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,791
Blog Entries: 17

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
I think it's telling you that your configuration does not meet the "Linux Standard Base." (If so, that's a rather cumbersome way of saying "syntax error.")

You don't mention what distro/version you are using, which is useful information because there can differences among how different distros do things. I can share my static ip configuration from my Debian system.

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

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.5
netmask 255.255.255.0

# iface eth0 inet dhcp

gateway 192.168.2.1
You might also check your router configuration. Most routers allow you to identify a pool of addresses for DHCP. The last one I installed started DHCP with xxx.xxx.xxx.2 (something I changed immediately). If yours does the same and the address you want to use as static is in that pool, it could be causing some confusion with the static IP.

Last edited by frankbell; 01-15-2014 at 09:50 PM.
 
Old 01-16-2014, 02:28 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,347

Rep: Reputation: 227Reputation: 227Reputation: 227
Wink

Quote:
Originally Posted by yoda987 View Post
Someone tell me what Im doing wrong here. Ive set a static IP on this box with following config:

nano /etc/network/interfaces

auto eth0 --> for dhcp
iface eth0 inet static --> Settings for static
address 172.18.240.25
netmask 255.255.255.0
gateway 172.18.240.1

Then

service networking restart

Then run

update-rc.d networking defaults

Which generates the following:

update-rc.d: warning: networking start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (none)
update-rc.d: warning: networking stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6)
System start/stop links for /etc/init.d/networking already exist.

Any time I reboot it, it pulls a new DHCP address until I restart networking again.
with frankbell posts, i notice in your settings have dhcp and static.

so I guess system takes the first parameter auto eth0.
take out auto eth0 and static ip addressing should work fine

Last edited by JJJCR; 01-16-2014 at 02:29 AM. Reason: edit
 
Old 01-16-2014, 03:28 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
The auto stanca has nothing to do with dhcp. At least not when its on the beginning of a line. Its just to say that if ifup -a is called that this device should be configured. Also this does not help solve your problem. Just telling so you don't remove it.

MAybe check output of dmesg and take a look at network configuration.
 
Old 01-16-2014, 05:14 AM   #6
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,136

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
I seem to recall that ifupdown uses the first entry in /etc/network/interfaces for any given interface.

It could just be that you're not in the same subnet with the gateway and client. Both must be in the private A, or B, or C subnets, not mixed. And you have to make sure network-manager isn't running also, because it disables ifupdown.
 
Old 01-16-2014, 09:13 AM   #7
yoda987
LQ Newbie
 
Registered: Mar 2011
Location: NC
Distribution: CentOS
Posts: 19

Original Poster
Rep: Reputation: 0
static IP is not in dhcp pool.
dhcp pool is same subnet.

Its a debian knockoff. I dont know much more than that other than some german guy made it. Its got a tool set in it Id like to use.
 
Old 01-17-2014, 05:17 AM   #8
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,347

Rep: Reputation: 227Reputation: 227Reputation: 227
Post

Quote:
Originally Posted by yoda987 View Post
static IP is not in dhcp pool.
dhcp pool is same subnet.

Its a debian knockoff. I dont know much more than that other than some german guy made it. Its got a tool set in it Id like to use.
for the static IP to work;
the LAN cable connected to your server or pc must be connected to a router or a switch which has the same subnet you had specified on /etc/network/interfaces
 
Old 01-17-2014, 08:11 AM   #9
dolphin_oracle
Member
 
Registered: Dec 2013
Posts: 342

Rep: Reputation: Disabled
I don't think you need to do the update-rc.d after changing your network interface settings. The rc.d system in debian is/has been going through a some changes over the years, and certain parameters in the various configuration files are deprecated. I think the error messages from that step are not part of your problem.

Is that your entire /etc/network/interfaces that you posted, or are there more bits inside? Also, are you using anything like network-manager or wicd in a gui or is this all cli stuff for you?

thanks.

d.o.
 
Old 01-21-2014, 02:48 PM   #10
sietze1977
LQ Newbie
 
Registered: Aug 2010
Posts: 21

Rep: Reputation: 0
Maybe this can help:

http://lounge.qacafe.com/kb/articles/show/371

Anyway what version of Linux you use might not be important in this case,
just make sure there is no network manager disabling the use
of /etc/network/interfaces file.


Since you are refering to a German made version of Debian
I presume it could be a (live) Knoppix cd or hdd install.
If it is installed to disk it can be changed
and also when booted from cd with the toram boot option that puts it into memory
(runs very fast).
but if it runs directly from cd some important files cannot be so easily changed.

Kind regards and succes

Sietze van de Burgt.

Last edited by sietze1977; 01-21-2014 at 02:49 PM.
 
  


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
[SOLVED] skype-4.0.0.7 static not working on slackware 13.37.0 vonbiber Slackware 14 07-04-2012 05:18 AM
Static IP's working, but random issues. Mol_Bolom General 3 05-01-2011 01:27 AM
[SOLVED] Static IP (private) not working figure002 Linux - Networking 27 11-19-2008 03:45 PM
Static Routes not Working tself Linux - Networking 5 09-19-2007 09:04 AM
static ip settings not working in fedora 4 lauren Linux - Networking 4 01-25-2006 07:45 AM

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

All times are GMT -5. The time now is 05:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration