Configure Network Interface

I am very new to the Red Hat OS and need some help getting started.  I installed a copy of Red Hat 6.5 as a virtual machine.  It appears I need to register the server but in order to do that I need to get it on the network.  Can someone please guide me on how to configure the interface through the command line?  If I do an ifconfig, I only see the lo int and not eth0.  I tried to edit using /etc/sysconfig/network-scripts/ifcfg-eth0, but I only see an option to change the address and not the subnet, dns or gateway.  Ideally, I would like to use the DHCP server.
NytroZAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

systechadminConsultantCommented:
0
Kent WSr. Network / Systems AdminCommented:
First, back up your /etc/sysconfig/network-scripts/ifcfg-eth0
Next, edit it and place this, and JUST this in it, to use DHCP.

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Open in new window


Optionally, you can place in the file, if needed -
DHCP_HOSTNAME=whatever.host.com

For a static IP, you can use this -

DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

Open in new window


Of course, replace the appropriate IP / NM with your own.
With both options, you can also use


HWADDR=00:0C:29:C7:A0:F0

..replace the MAC address above with whatever you need.

After saving the file, do a

service network restart (or however you prefer to restart networking) to make active.
0
NytroZAuthor Commented:
Like I said in the question, I do not see the option to set the subnet or gateway.  

redHatifconfig.png
0
Kent WSr. Network / Systems AdminCommented:
Just add a line -

GATEWAY=192.168.1.1

with your actual Gateway IP.
Restart networking.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

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.