LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 11-17-2011, 11:42 PM   #1
cgirishaanekal
LQ Newbie
 
Registered: Nov 2011
Posts: 26

Rep: Reputation: Disabled
Static IP


how to assign static ip for ifconfig eth0 in fedora core
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-17-2011, 11:50 PM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Temporarily
Code:
# ifconfig down ethx
# ifconfig ethx x.x.x.x netmask x.x.x.x etc 
# ifconfig ethx up
Permenantly
edit /etc/sysconfig/network-scripts/ifcfg-ethx with the relevant information.
and
Code:
 # /etc/init.d/network restart
or
Code:
 ifconfig ethx down && ifconfig ethx up
Although it is better to assign a static lease with the DHCP server (on your router/modem/gateway/etc) as this will better handle conflicting IP's.
 
Old 11-18-2011, 12:42 AM   #3
tollingalong
Member
 
Registered: Nov 2011
Posts: 42

Rep: Reputation: Disabled
#cd /etc/sysconfig/network-scripts <== if it's red hat then this is where your NIC settings will go
# cat ifcfg-eth0 <== default 1st interface file

<This stuff is what you need in the config file>
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
 
2 members found this post helpful.
Old 11-18-2011, 01:40 AM   #4
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by tollingalong View Post
#cd /etc/sysconfig/network-scripts <== if it's red hat then this is where your NIC settings will go
# cat ifcfg-eth0 <== default 1st interface file

<This stuff is what you need in the config file>
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
if Fedora is exactly like rhet/centos then this part is correct. Be sure to put name server in /etc/resolv.conf

/etc/resolv.conf
Quote:
nameserver 8.8.4.4
nameserver 8.8.8.8
Like that. You can use those IP's if you wish they are googles open dns servers but your IP should provide you with atleast 2 ips for DNS.
 
1 members found this post helpful.
  


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
setting static IP on linux PCs with no static IP address from internet provider? solvetek Linux - Networking 1 10-22-2011 08:04 AM
Java non-static variable cannot be referenced from a static context issue rickrvo Programming 2 02-12-2010 03:26 PM
How to initialize a static array of a class in a static member function lali.p Programming 9 02-16-2008 09:27 AM
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
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM


All times are GMT -5. The time now is 01:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration