LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 03-17-2008, 12:22 PM   #1
robcast
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
Unhappy How do I assign a static IP to an interface on a Fedora Linux box?


I am trying to learn linux from the CLI. How can I assign an IP address to an interface from the CLI?
 
Old 03-17-2008, 12:24 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
you shoudl be able to use system-config-network outside of x to get a console interface to it, but you can also just directly eddit the config file - /etc/sysconfig/network-scripts/ifcfg-eth0 and specifiy the IPADDR and other details:
Code:
DEVICE=eth0
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1
ONBOOT=yes
 
Old 03-17-2008, 12:56 PM   #3
iamwilliam
Member
 
Registered: Apr 2006
Location: Nairobi
Distribution: CentOS
Posts: 78

Rep: Reputation: 21
Code:
/sbin/ifconfig ethXX ip.add.re.ss
check out man ifconfig for more
 
Old 03-17-2008, 12:58 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
well i guess that does technically answer the question more correctly... the config file i listed is used by automated boot scripts to recreate the manual command as listed by iamwilliam, so his answer is a single shot to do the task instantly, the config file will persist across boot and more.
 
Old 03-18-2008, 01:37 PM   #5
robcast
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for your help guys. I really appreciate it. I am a Windows Server Admin with 10 years of that is trying to keep my family fed by jumping into Linux and Asterisk. I am trying to master Fedora since it is what we work with most on our FreePBX deployments, as well as Switchvox. Thanks again.
 
  


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
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 11:51 AM
How To Assign Static Ip? betrussell23 Linux - Networking 5 09-27-2006 02:25 AM
assign static ip allelopath Linux - Software 1 04-27-2005 08:04 PM
assign static IP to the server ashley75 Linux - General 2 03-10-2005 04:47 PM
How do I assign a static IP to eth0 louisb Linux - Networking 4 02-19-2005 09:10 PM


All times are GMT -5. The time now is 07:30 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