LinuxQuestions.org
Help answer threads with 0 replies.
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-01-2011, 04:03 AM   #1
linux in malawi
LQ Newbie
 
Registered: Jun 2011
Location: Blantyre malawi
Distribution: Redhat 9, fedora 13 and ubuntu 10.4
Posts: 9

Rep: Reputation: Disabled
Ifconfig


Hie
when i type 'ifconfig eth0 192.168.25.1 255.255.255.0' the outcome is 'SIOCSIFADDR : invalid argument', but when i check the ip address using /sbin/ifconfig i see the ip address is updated to 192.168.25.1 and is up. When i restart the linux box,the /sbin/ifconfig is reset to 192.168.100.1 .what should i do so that the linux box /sbin/ifconfig should not change when am rebooting.
Thank you for your helping answer in advance.
 
Old 07-01-2011, 04:36 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
cd /etc
grep -r 192.168.100.1 *
I'm also not that familiar with networking so this is what I would use to find the file that contains the ip address that is used at boot. Replace the IP address that is defined in those files by the new one.
 
1 members found this post helpful.
Old 07-01-2011, 05:04 AM   #3
csravi88
LQ Newbie
 
Registered: Jun 2010
Distribution: RHEL, CentOS, Debian, AIX
Posts: 15

Rep: Reputation: 0
Thumbs up

which distro you are using? i was using "setup" command in centos. then select networking option.
 
Old 07-01-2011, 05:08 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,320

Rep: Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905
The correct syntax would be:
ifconfig eth0 192.168.25.1 netmask 255.255.255.0

You do not mention which distribution but both Fedora,Redhat and Ubuntu have networking configuration utilities that will configure network adapters and save the static IP address settings.
 
1 members found this post helpful.
Old 07-01-2011, 05:26 AM   #5
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
this is set in this text file: /etc/sysconfig/network-scripts/ifcfg-eth0 if you use good old networking.
if you use NetworkManager, then it's a different story
 
Old 07-01-2011, 07:11 AM   #6
linux in malawi
LQ Newbie
 
Registered: Jun 2011
Location: Blantyre malawi
Distribution: Redhat 9, fedora 13 and ubuntu 10.4
Posts: 9

Original Poster
Rep: Reputation: Disabled
For knowledge and future use i want to know how /etc/sysconfig/network-scripts/ifcfg-eth0 should be like.
 
Old 07-01-2011, 07:33 AM   #7
linux in malawi
LQ Newbie
 
Registered: Jun 2011
Location: Blantyre malawi
Distribution: Redhat 9, fedora 13 and ubuntu 10.4
Posts: 9

Original Poster
Rep: Reputation: Disabled
Am using redhat 9
 
Old 07-01-2011, 08:06 AM   #8
paparts
LQ Newbie
 
Registered: Aug 2010
Posts: 15

Rep: Reputation: 0
ifconfig eth0 192.168.25.1 netmask 255.255.255.0
 
Old 07-01-2011, 08:32 AM   #9
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779
Are you really using "Red Hat 9"? Quoting from wikipedia: Red Hat Linux 9, the final release, hit its official end-of-life on 2004-04-30 If you really are using a re revision this old, you are both setting yourself up for serious security issues and focusing on learning deprecated techniques. If you want the "red hat" experience without paying for RHEL, go with either Fedora or CentOS.

Here is a link to the CentOS documentation, chapter 14 provides information on configuring the network. BTW, CentOS is the free version Red Hat and may be a little bit behind, but should achieve your goals.
 
1 members found this post helpful.
Old 07-01-2011, 08:32 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,320

Rep: Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905
FYI Redhat 9 is extremely obsolete and Fedora 13 is no longer being supported. ifcfg-eth0 is a network configuration file for Redhat base distributions. Here is an example:
Quote:
# File: ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.25.1
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
#
# The following settings are optional
#
BROADCAST=192.168.2.255
NETWORK=192.168.2.0
system-config-network is a RH9 GUI tool for configuring your network adapter.

Last edited by michaelk; 07-01-2011 at 08:37 AM.
 
1 members found this post helpful.
Old 07-04-2011, 12:53 AM   #11
linux in malawi
LQ Newbie
 
Registered: Jun 2011
Location: Blantyre malawi
Distribution: Redhat 9, fedora 13 and ubuntu 10.4
Posts: 9

Original Poster
Rep: Reputation: Disabled
I changed this values in /etc/sysconfig/network-scripts/ifcfg-eth0 file 'BOOTPROTO=static' from 'BOOTPROTO=dhcp' and i added my ip address and netmask.
IPADDR=192.168.25.1
NETMASK=255.255.255.0
 
  


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
Why "-bash: ifconfig : command not found" when typing "$ifconfig" dangdtvn Linux - Server 9 09-20-2013 07:01 AM
ifconfig - RX/TX ? czezz Solaris / OpenSolaris 1 02-21-2008 04:48 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 08:58 AM
Ifconfig mrodriguez Linux - Newbie 2 02-16-2005 01:17 PM
ifconfig LinuxRam Linux - Newbie 3 08-28-2004 11:15 PM

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

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