LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-29-2004, 09:29 AM   #1
Rig24
LQ Newbie
 
Registered: Dec 2002
Location: McLean
Posts: 28

Rep: Reputation: 15
Configuring IP to network card


I am trying to assign a static IP address to a network card using the following command:
ifconfig eth0 10.4.12.21

After the command it works fine untill the system is rebooted and then I neet to issue the command again. How do you make the IP address stick?
 
Old 04-29-2004, 09:33 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Most distros should have scripts configured to bring up network interfaces on start up.
 
Old 04-29-2004, 10:49 AM   #3
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Which distribution are you using ?

If your distro. has the sysconfig directory, you can edit the /etc/sysconfig/network/ifcfg-eth0 file.

On RedHat / Mandrake, it would look like this:
Code:
DEVICE=eth0
BOOTPROTO=none
IPADDR=10.4.12.21
NETMASK=255.0.0.0
BROADCAST=10.4.12.255
NETWORK=10.4.12.0
onBOOT=yes
On SuSE, like this:
Code:
BOOTPROTO='static'
BROADCAST='10.4.12.255'
IPADDR='10.4.12.21'
NETMASK='255.0.0.0'
NETWORK='10.4.12.0'
STARTMODE='onboot'
Check your distribution's documentation to get more info.
 
Old 04-29-2004, 11:02 AM   #4
Rig24
LQ Newbie
 
Registered: Dec 2002
Location: McLean
Posts: 28

Original Poster
Rep: Reputation: 15
I am running RedHat 7.3. I found the ifcfg-eth0 in the /etc/sysconfig/network-scripts/ directory. This is what is in it:

DEVICE='eth1'
ONBOOT='no'
BOOTPROTO='none'
TYPE='Ethernet'
USERCTR='no'
NETWORK=10.4.0.0
BROADCAST=10.4.0.255

Should I change the NETWORK and BROADCAST lines and nothing else?
 
  


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
Configuring Network Card Echo Kilo Linux - Networking 4 06-04-2005 10:15 AM
problem with kudzu configuring network card holzer Linux - Hardware 0 03-10-2004 03:23 PM
Help with detecting and configuring network card kalikoder Linux - Networking 2 01-17-2004 09:14 PM
Problems configuring network card vhii Linux - Networking 5 10-02-2003 05:21 PM
configuring network card alkee Linux - Networking 3 02-12-2002 10:00 PM


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