?
Solved

centos assign ip address

Posted on 2014-08-27
13
Medium Priority
?
817 Views
Last Modified: 2014-08-30
I have a fresh install of cent os 7. How can I assign the IP address  to use dhcp? I don't even see an /etc directory when I do a ls command. Its all blank except anaconda-ks.cfg file.
0
Comment
Question by:Starquest321
13 Comments
 
LVL 25

Assisted Solution

by:Zephyr ICT
Zephyr ICT earned 668 total points
ID: 40287338
That's because you are in the root home folder ... type "cd /etc/sysconfig/network-scripts/" this will bring you in the network scripts folder.

Here you can perform your ls again and you will see the network-scripts.

then type "vi ifcfg-ens192" (if that is the name of your network adapter)
In this file you can adjust settings to DHCP.

These settings should be there for you if you want DHCP and your adapter automatically enabled during boot:

BOOTPROTO="dhcp"
ONBOOT="yes"
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 40287340
btw ... You might get your nic to work if you perform following command:

"ifup ens192"

Might not be enabled during boot, see post above
0
 

Author Comment

by:Starquest321
ID: 40287345
Weird .. my default install is the file is called ifcfg-lo ... and I don't have the dhcp entries there. I just have a loopback address of 127.0.0.1
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 40287349
Is that the only network script you see? Can you give more detail about your computer/device? Is it a physical or virtual machine?
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 40287359
Another tip I can give, you can normally use the tool "nmtui" to configure your network connections, might come in handy when you have a network connection. This is a command line "wizard" tool kind of thing ... If you don't feel comfortable using cli and text files ...
0
 
LVL 13

Accepted Solution

by:
Sandy earned 668 total points
ID: 40287458
run below command and paste output pls

#dmesg | grep -i eth
#ifconfig -a

TY/SA
0
 

Author Comment

by:Starquest321
ID: 40293649
Here are the results. I would appreciate any help. No matter which IP try it doesn't work. Is there some firewall that I need to enable?
network.jpg
0
 
LVL 5

Assisted Solution

by:NARANTHIRAN
NARANTHIRAN earned 664 total points
ID: 40294150
Run the setup command -->Select Network configuration-->Select the device and  assign Ip address..

For more details go through the link..
http://computernetworkingnotes.com/network-administrations/basic-networking-commands.html
0
 

Author Comment

by:Starquest321
ID: 40294641
I am using the network manager TUI .. and I am able to ADD a device .. but the device NAME is BLANK.  Should I put eth0? Why isn't the NIC install standard?
0
 

Author Comment

by:Starquest321
ID: 40294721
Accepted the solution before completely working. . I thought I did. In fact I thought I had 192.168.0.137 as the IP address..but why don't I have eth0 as the internet card?

Also I installed apache successfully but cannot load. So I think it's the network.

I get a ping reply from 192.168.0.137...

What can be wrong?
0
 

Author Comment

by:Starquest321
ID: 40294723
0
 

Author Comment

by:Starquest321
ID: 40294724
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question