Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local Host Computer Name 1

Status
Not open for further replies.

hotblacktar

IS-IT--Management
Jan 31, 2002
74
US
I am having trouble with my network adaptor on redhat 7.3

Everytime I reboot I have to go into my network configuration (terminal window > neat) and reactivate the ethernet card.

This always works but it is getting annoying.

I recently changed the name of the computer in the Hosts file so I am wondering if this change has an effect on the nic.

My current Hosts configuration is:

xxx.xxx.xxx.xxx mycomputer.mydomain
127.0.0.1 localhost

Is this how it should be written?

Also, in the network configuration gui on the Hosts tab both of these are listed. If I have the nic set to use DHCP
how does this impact the static ip in the Hosts file that corresponds with the computer name? Do I need to enter a static address in Net config?

Thanks for the help.


 
localhost should be first in the hosts file. If your using DHCP, you should not have a static IP set in the hosts file.

What command are you using to activate the NIC? I'm guessing "ifconfig eth0 up" or one of the DHCP renew commands?

You shouldn't have to do this, but you can always add the command you are using to the end of the /etc/rc.d/rc.local file. Don't do this at this point. Show us the command your using and we'll tell you which files to edit.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 
I am actually typing the command "neat" which brings up the net config gui. I highlight the nic and click the Activate button.

In regards to static IP in the Hosts file, I use the Hosts file to change the computer name. What would be the correct entry?

Thanks
 
I don't use GUI tools, I do everything from the command line.

The /etc/hosts file is for name resolution only. To change the hostname of the server, change the /etc/sysconfig/network file and then type hostname=whatever.

[root@rh etc]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rh.foo.org

How do you know the card is not activated? Start the computer and type 'ifconfig' and see if eth0 is up.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 
I know the card is not activated because I can't get online.

The network card is still not working on reboot but is easily restarted. It must not be related to my network configuration and may be an alll together different hardware issue. Is there a command for restarting the nic so I can skip the GUI interface?

Thanks for the network advice. As I am new to Linux that has really helped clear up some of the confusion.
 
When you can't get online, type "ifconfig" and tell me if it shows eth0 or not.

To restart networking services, try...

/sbin/service network restart

To just bring the eth0 interface up when its down, try...

ifconfig eth0 up

See if those commands bring up the eth0 interface when it is down.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 
When I restart and cannot get online I entered the ifconfig command and only got the configuration for lo local loopback.

I then entered /sbin/service network restart. After a succesful restart ifconfig returned settings for eth0 and lo but I did not pick up an IP and was still of line. and the NIC is still inactive.

The ifconfig eth0 up command does not work for making the card active.

 
Check the /etc/sysconfig/network-scripts directory for the file "ifcfg-eth0". If it does not exist, create it and put this in it...

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 
That file exists.

When I log on after a reboot I get this message:

"Could not look up internet address for mycomputer.mydomain. It may be possible to correct the problem by adding mycomputer.mydomain to /etc/Hosts"

If this related to the NIC problem what type of entry would I put in the Hosts file if I shouldn't add a static IP for my machine?




 
Try this in /etc/hosts then...

127.0.0.1 localhost.localdomain localhost
127.0.0.1 mycomputer.mydomain mycomputer


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 
Success! This last suggestion did the trick. All of your tips have been a big help and good learning experience. Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top