LinuxQuestions.org
Review your favorite Linux distribution.
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 07-12-2011, 10:03 AM   #1
mandu
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Rep: Reputation: 0
how to setup static ip address via terminal


I imagine that there is already a thread for setting up a static IP, but I haven't been able to find it yet, so here we go.

I have recently installed Fedora 15 on my home machine. I have a very simple home network. Belkin wireless router with Window and Linux systems. The router is setup to be DHCP server. Router is setup to have lease time = Forever. Even with this setup, my router is assigning different IP address for my linux machine every time I boot the machine. So I would like to setup a static IP on my Linux.

From my research so far, I'm suppose to make some changes to the file /etc/sysconfig/network-scripts/ifcfg-eth0. But I don't have this file in this folder. Should I just create this file? If yes, what goes in this file?

Thanks for your help
 
Old 07-12-2011, 10:09 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
just run "system-config-network" and set things there. that will create the ifcfg file.

example contents:


DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.5.100.20
NETMASK=255.255.255.0
 
1 members found this post helpful.
Old 07-12-2011, 10:54 AM   #3
travisdh1
Member
 
Registered: Sep 2008
Distribution: Fedora
Posts: 129

Rep: Reputation: 22
You also might want to turn off network manager and turn on network service. Use system-config-services to do that or use the following commands.

Code:
sudo chkconfig NetworkManager off
sudo chkconfig network on
NetworkManager still seems to create more problems than it fixes for cabled networks
 
1 members found this post helpful.
Old 07-12-2011, 11:11 AM   #4
mandu
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
Thank again acid. system-config-network didn't work the first time (didn't have the "add" option). So I ended up creating it manually. After the manual add, i tried the system-config-network again. I was able to see the newly created config. Strange.
 
  


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
How to Setup Static IP Address on Debian Linux Boxes through 2 Switches danmartinj Linux - Networking 5 10-27-2009 07:06 PM
setup Static IP address for centOS and access to ssh careykwong Linux - Networking 14 09-23-2009 10:02 PM
Setup static ip-address in kubuntu? Silver565 Linux - Newbie 4 08-16-2009 12:08 AM
setup the static ip address hansi umayangan SUSE / openSUSE 1 04-04-2005 02:54 AM
Verizon aDSL setup with static IP address RH9 server costasm Linux - Networking 1 10-16-2003 02:19 PM

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

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