LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-18-2004, 07:52 PM   #1
firefly2442
Member
 
Registered: Apr 2003
Location: USA
Distribution: Ubuntu
Posts: 95

Rep: Reputation: 15
Question Setting up static IP using ifconfig


Hello. I'm trying to setup a static IP for my machine that is running "Damn Small Linux" (a variation of Knoppix). When I go into /etc/network/interfaces, I added a static eth0 card as follows...

# Ethernet Card
eth0 auto
iface eth0 inet static
address 192.168.1.4
netmask 255.255.255.0



When I restart and run ifconfig, it seems to show up for a moment with no IP address set. Then if I run ifconfig again it goes away and I am left with only "lo" set up.

I can run "ifconfig eth0 192.168.1.4" correctly and it gives me an IP address which I can use to ping other machines. Is there anything else I am missing? Thank you in advance.
 
Old 07-19-2004, 12:53 AM   #2
devfreak
Member
 
Registered: Mar 2004
Location: Maine
Distribution: gentoo 2004.1, ubuntu 4.10, FC3
Posts: 97

Rep: Reputation: 15
my thinking is that maybe when you are doing ifconfig eth0 command (and this is only the best guess I can think of, and it's only if you still have dhcp avail) you are having the valuables like gateways and stuff filled out for you by either old connections that are somehow cached or dhcp if you still have it up. Have you tried filling out that stuff manually?
 
Old 07-19-2004, 12:56 AM   #3
devfreak
Member
 
Registered: Mar 2004
Location: Maine
Distribution: gentoo 2004.1, ubuntu 4.10, FC3
Posts: 97

Rep: Reputation: 15
While I'm at it, here's an example of what gentoo likes to hear:
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
 
Old 07-19-2004, 01:17 AM   #4
firefly2442
Member
 
Registered: Apr 2003
Location: USA
Distribution: Ubuntu
Posts: 95

Original Poster
Rep: Reputation: 15
I tried putting in the additional information but it still doesn't work. When I startup the computer though, the Knoppix auto hardware detection finds my eth0 card and sets it to try to find an IP address becasue it says, "DHCP broadcasting for IP". Could this be the reason?
 
Old 07-19-2004, 01:51 AM   #5
devfreak
Member
 
Registered: Mar 2004
Location: Maine
Distribution: gentoo 2004.1, ubuntu 4.10, FC3
Posts: 97

Rep: Reputation: 15
I think that's very likely. Now, you say that Damn Small is based on knoppix, and I believe that knoppix is based on debian, and it looks by your profile that you use all three. If you have the other two working and not damn small, then I think you may want to start comparing things. You're right to do this, though. Turning off dhcp is a decent security device from net hunters.
 
Old 07-19-2004, 08:29 AM   #6
firefly2442
Member
 
Registered: Apr 2003
Location: USA
Distribution: Ubuntu
Posts: 95

Original Poster
Rep: Reputation: 15
I found this answer on the knoppix forum and it worked!

Quote:
I found a file /etc/init.d/knoppix-autoconfig

Configuration for knoppix start-up is in this file so I also found that there was an instruction :

pump -i $DEVICE >/dev/null 2>&1 &

I know that instruction is find the DHCP server.

So I disable that instruction and replace with
/etc/init.d/networking restart
Thanks for helping me devfreak.
 
Old 07-19-2004, 10:57 AM   #7
devfreak
Member
 
Registered: Mar 2004
Location: Maine
Distribution: gentoo 2004.1, ubuntu 4.10, FC3
Posts: 97

Rep: Reputation: 15
no problem, and thanks for posting your findings for future googles.
 
  


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
Setting a static IP hongman Linux - Networking 6 02-22-2005 06:07 AM
IFConfig and static IP Buto Slackware 4 10-21-2004 04:47 PM
setting a static IP EMHagerty Linux - Networking 1 09-09-2004 04:15 PM
ifconfig/netconfig in Redhat 9 (static IPs) GomiCowboy Linux - Networking 6 09-07-2003 02:11 PM
ifconfig: From DHCP to static IP koyi Linux - Networking 5 09-02-2003 05:08 AM


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