Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> How To Set Static Ip On Linux?
Termina
post Mar 12 2004, 11:01 PM
Post #1


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



I have several computers on my LAN, and would like each to have the same IP every time they start up.

How could I do this? Thanks!


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
hughesjr
post Mar 13 2004, 07:00 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



It depends on your distro ....

I know you use mostly debian ... and I assume you have a DHCP server and and internal IPs (10.x.x.x or 192.168.x.x).

I don't know what you are doing for the DHCP server ... but on DHCP servers, you can assign a reservation for a specific MAC address to get a specific IP address...that is one way. Here is an easier one:

In the device that controllers the IP addresses, make sure to block off a range that doesn't get assigned ... for example, if you are using the 192.168.0.0 network, 192.168.0.1 is probably your gateway ... set the dhcp range that the server will give to something like 192.168.0.21 - 192.168.0.50.

Now you can make static assignments from 192.168.0.2 - 102.168.0.20 .... and > 192.168.0.51 ... but the system can still assign from 192.168.0.21 to 192.168.0.50 to PCs using dhcp.

Make sure you exclude the static assignments from the dhcp server (as discussed in the above 2 paragraphs), otherwise if you leave any PC on DHCP, it could get assigned an address that duplicates your static address.

Now to make a static assignment (in debian), edit the file /etc/network/interfaces and remark out (put a # in front of it) the line:

iface eth0 inet dhcp

so it becomes this:

#iface eth0 inet dhcp

The add a lines like this at the bottom of the file:
CODE
iface eth0 inet static
   address 192.168.0.2
   netmask 255.255.255.0
   gateway 192.168.0.1

(substitute the address you want for 192.168.0.2 ... and the gateway)
--------------------------
In whitebox, you can use the command:

redhat-config-network


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Termina
post Mar 13 2004, 12:25 PM
Post #3


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



Thank you very much for answering all my questions. happy.gif


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
hughesjr
post Mar 13 2004, 01:00 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



your welcome biggrin.gif


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 11th December 2017 - 04:34 AM