Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6078
  • Last Modified:

assign static IP from CLI in Fedora 5

Hi,
I would like to assign static IP address to eth0 from command line interface in Fedora 5. I did look around. I found that:
ifconfig eth0 192.168.2.33 netmask 255.255.255.0 up
Should do it. However, whenver i typed it returns:
Returned:
-bash: ifconfig: command not found

Than i tryed:
./ ifconfig eth0 192.168.2.33 netmask 255.255.255.0 up
Returned:
-bash: ifconfig: command not found

I tryed other commands(i.e. ifstatus) with the same outcome. How do i assign static IP to eth0 from CLI in Fedora 5?
Thank YOu,
M
0
margotsk
Asked:
margotsk
1 Solution
 
alextoftCommented:
It sounds like your environment variable PATH is not including the location of ifconfig. Not a Fedora user myself, but it should be in /sbin

Try /sbin/ifconfig eth0 192.168..... etc
0
 
alextoftCommented:
Also, Fedora (at least it used to) has locate installed by default, so try locate ifconfig

It'll be there, somewhere..
0
 
ravenplCommented:
You propably trying run this command as regular user. Try as root
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
jar3817Commented:
You can also edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file. You should make it look something like this:

DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.2.255
IPADDR=192.168.2.33
NETMASK=255.255.255.0
NETWORK=192.168.2.0
ONBOOT=yes

Then just bring the interface down and up again: /sbin/ifdown eth0 && /sbin/ifup eth0
0
 
slyongCommented:
I prefer to use the system-config tool... there is a system-config-network-tui for CLI.
as ravenpl said.. run as root:

$ su -
enter your root password
# system-config-network-tui
0
 
margotskAuthor Commented:
Thanks for response,
I followed jar3817 suggestion and it worked. I am sure other sollution may work, but jar3817 suggestion seemed more fit in our case. Thank You for your responses
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now