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 07-01-2011, 03: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, 03:36 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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, 04: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, 04:08 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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, 04: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, 06: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, 06: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, 07: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, 07:32 AM   #9
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
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, 07:32 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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 07:37 AM.
 
1 members found this post helpful.
Old 07-03-2011, 11:53 PM   #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



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 06:01 AM
ifconfig - RX/TX ? czezz Solaris / OpenSolaris 1 02-21-2008 03:48 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
Ifconfig mrodriguez Linux - Newbie 2 02-16-2005 12:17 PM
ifconfig LinuxRam Linux - Newbie 3 08-28-2004 10:15 PM

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

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