Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Newbie > setting static ip

Forgot Password?
 Linux Newbie   If you're new to the wonderful world of Linux, start here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 01-30-2003   #1 (permalink)
Linux Engineer
 
Join Date: Nov 2002
Location: Queens, NY
Posts: 1,319
Send a message via AIM to bpark
setting static ip

I need help setting up a static ip for my linux workstation. I have all the necessary information to set it up but I'm having trouble with some other things.

1. I'll need to stop dhcp(client) from running when the machine starts up. How can I disable dhcp? I'm under the impression that some file will contain this info.

2. It's been brought to my attention that the following files are manipulated when we deal with networking: /etc/network/interface, /etc/resolve.conf, and /etc/hostname.
I am aware of what to edit in /etc/network/interface and /etc/hostname but I'm not sure what /etc/resolve.conf does. Can anyone tell me what the purpose of this file is?
__________________
The best things in life are free.
bpark is offline  


Reply With Quote
Old 01-30-2003   #2 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
What distro do you have?
/etc/resolv.conf - your name servers go in there
/etc/hostname - hostname for your box

As for the network config files, they varie from distro to distro.
genlee is offline   Reply With Quote
Old 01-30-2003   #3 (permalink)
Linux Engineer
 
Join Date: Nov 2002
Location: Queens, NY
Posts: 1,319
Send a message via AIM to bpark
debian

Genlee,

I'm using debian linux. I know how to configure that /etc/network/interface because I read up on it but I wasn't sure about the other two files. It looks something like this
Code:
 
     # An example static IP setup: (broadcast and gateway are optional)
     #
     auto eth0
     iface eth0 inet static
          address 192.168.0.42
          network 192.168.0.0
          netmask 255.255.255.0
          broadcast 192.168.0.255
          gateway 192.168.0.1
1. What exactly is a name server? I've had dhcp configure everything from installation so I don't know what that is. Also, I'm very new to networking so I don't have much idea about what this is.
2. As for /etc/hostname, it's just the name of the workstation. That was pretty simple to figure out.
3. Do you know how I can stop the dhcp(client) from starting at boot time? As I mentioned before, I'm sure that every distro uses a file to have the programs when it first boots.
__________________
The best things in life are free.
bpark is offline   Reply With Quote
Old 01-30-2003   #4 (permalink)
Linux User
 
Join Date: Jul 2002
Location: Daytona Beach, FL
Posts: 487
Send a message via AIM to majorwoo
1 - a nameserver is a machine that snswers DNS requests, or translates www.google.com to 216.239.35.100 (google's IP address)

2 - yup

3 -if dhcp is starting on boot you must have a network device set to use dhcp, check your

/etc/sysconfig/network-scripts/ifcfg-eth0 (and maybe eth1, eth2 depending on how many NIC's you have)

(i am not certain debian uses those same filenames, but if not, man ifconfig should help
__________________
majorwoo

Quiet brain, or I\'ll stab you with a Q-tip.
majorwoo is offline   Reply With Quote
Old 01-30-2003   #5 (permalink)
Linux Engineer
 
Join Date: Nov 2002
Location: Queens, NY
Posts: 1,319
Send a message via AIM to bpark
fixed

Majorwoo,

Well, thanks for your help. When I edited /etc/network/interfaces, debian actually checks that file everytime it reboots or shutdown. Therefore on the next boot, it'll know to either launch dhcp or to NOT launch it. For some reason, I always thought that there was file that specified which programs to execute upon start of the machine.
I still have a question regarding the nameserver. Do I have to have one? I'm running this machine at home for my own sake and if anything, I'd broadcast this to the network at home not to the internet. I'm thinking I can leave this alone since I don't have any servers at home or for the internet. Out of curiosity, can I run my own nameserver for the network?
By the way, what distro are you running? The example you provided didn't work at all since I don't have that directory.
__________________
The best things in life are free.
bpark is offline   Reply With Quote
Old 01-30-2003   #6 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
I would advise you to setup a name server setup because being able to resolve hostnames does come in handle all the time You can run your own one. apt-get bind should install it for you. Then just
echo "nameserver 127.0.0.1" > /etc/resolv.conf
The config files that majorwoo said to change are for redhat and not debian so you won't have them anywhere.
genlee is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 12:16 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2