Results 1 to 6 of 6
Thread: setting static ip
|
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
01-30-2003 #1Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
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.
-
01-30-2003 #2Linux 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.
-
01-30-2003 #3Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
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 this1. 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.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
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.
-
01-30-2003 #4Linux User
- Join Date
- Jul 2002
- Location
- Daytona Beach, FL
- Posts
- 487
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 helpmajorwoo
Quiet brain, or I\'ll stab you with a Q-tip.
-
01-30-2003 #5Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
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.
-
01-30-2003 #6Linux 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.


Reply With Quote