LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-04-2005, 07:27 PM   #1
Stormfront
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
Post Static IP


How do I change my Linux box from DHCP to a static IP? I'm useing Debian with KDE.

 
Old 01-04-2005, 07:32 PM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
I just went through this,how do you connect?What distro?What isp?Give us the numbers you have like;
Code:
ifconfig_eth0=( "192.168.1.97 netmask 255.255.255.0 broadcast 255.255.255.255" )
routes_eth0=( "default gw 192.168.1.254" )

Last edited by comprookie2000; 01-04-2005 at 07:35 PM.
 
Old 01-04-2005, 10:15 PM   #3
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
What you're asking is very easy to do. The file that you need to edit is /etc/network/interfaces.

If you're currently set to accept a DHCP address, you should change the line that reads
Code:
iface eth0 inet dhcp
to read
Code:
iface eth0 inet static
and then add any of these lines as appropriate to your system:

Code:
address X.X.X.X
netmask Y.Y.Y.Y
network Z.Z.Z.Z
broadcast A.A.A.A
gateway B.B.B.B
If it is an internal network, and all you need is an IP, then I think you can get away with just an address. Most times you will need at least an address, gateway, and subnet to get out on the internet. The network and broadcast ear easy to figure out, they are usually the lowest and highest addresses in your subnet.

Once all that is changed to how you like it, do
Code:
ifdown eth0
and then follow with
Code:
ifup eth0
and you'll have the new address activated.


Peace,
JimBass

Last edited by JimBass; 01-04-2005 at 10:16 PM.
 
Old 01-05-2005, 04:48 PM   #4
Stormfront
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Very helpful. Works great. Thanks alot
 
  


Reply



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
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
Is there any static ARP for static IP network? linux_lover2005 Linux - Networking 2 05-18-2005 12:01 PM
no static ip need help kwickcut Mandriva 1 12-07-2004 06:59 PM
Can't use static IP linuxistan Linux - Networking 5 10-17-2004 09:26 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM

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

All times are GMT -5. The time now is 10:45 PM.

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
Open Source Consulting | Domain Registration