LinuxQuestions.org
Visit Jeremy's Blog.
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 03-17-2008, 11:22 AM   #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, 11:24 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 11:56 AM   #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, 11:58 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 12: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



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
How To Assign Static Ip? betrussell23 Linux - Networking 5 09-27-2006 01:25 AM
assign static ip allelopath Linux - Software 1 04-27-2005 07:04 PM
assign static IP to the server ashley75 Linux - General 2 03-10-2005 03:47 PM
How do I assign a static IP to eth0 louisb Linux - Networking 4 02-19-2005 08:10 PM

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

All times are GMT -5. The time now is 07:58 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
Open Source Consulting | Domain Registration