Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed Redhat 6 x86_64. I am using the Network connection screen to set a static IP address like below (I want two PC's in my house to see each other: one Redhat PC and one Mac)

192.168.0.5  
255.255.255.0  
192.168.0.1  

When I run ifconfig it displays only lo and virbr0 information. I don't know what these items are (I don't really know much about network settings).

When I try ifconfig -a it displays eth0, lo, sit0 and virbr0. The information for eth0 is as follows:

Link encap : Ethernet HWaddr 90:2B:34:74:05:30
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:192 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:1000
RX bytes 53811 (52.5 KiB) TX bytes:468 (468.0 b)
Interrupt:29 Base address:0xc000

Could someone help me to point out if anything wrong with my setting or how to resolve this problem?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

You can provide static IP by editing the file /etc/sysconfig/network-scripts/ifcfg-eth0 as root user in Redhat.

It should look like this:

DEVICE=eth0
BOOTPROTO=STATIC
IPADDR=192.168.0.5
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes

After saving this file. You need to restart the network daemon using following command.

$ sudo /etc/init.d/network stop
$ sudo /etc/init.d/network start

This should provide IP address to eth0 interface also. And ifconfig command should list eth0 also.

share|improve this answer
    
thanks for your quick answer. i did the same thing before but cannot solve. i ran ifconfig eth0 192.168.0.5 netmask 255.255.255.0. and it solved my problem. i don't know what's wrong. With this setting, when i restarted by using /etc/init.d/network stop/start, then ifconfig --> again it hide the [eth0] –  Phu Nguyen Oct 21 '12 at 13:43
    
Can you try booting the computer once. After that ifconfig command should show everytime eth0. You can try using sudo ifup eth0 if you don't want to reboot. –  pradeepchhetri Oct 21 '12 at 14:00
    
restart help solving my problem. thank you very much –  Phu Nguyen Oct 21 '12 at 14:02
    
@PhuNguyen: Thank you too :) –  pradeepchhetri Oct 21 '12 at 14:26
    
You probably want to make sure that the network service starts on boot, so you'll want to run /sbin/chkconfig network on as root. –  jsbillings Apr 23 '13 at 23:34

After you configure the ip address run the following commands 1.service NetworkManager stop 2.chkconfig NetworkManager off it will retain the provided ip even after booting.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.