LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   # cd /etc/sysconfig/network-scripts/?? (https://www.linuxquestions.org/questions/linux-newbie-8/cd-etc-sysconfig-network-scripts-4175584418/)

Joseph2016 07-12-2016 10:53 AM

# cd /etc/sysconfig/network-scripts/??
 
Hello


I have installed CENTOS 6

I have and can LOG On with root.

I am trying to SET the IP for my sever....( default )

I was reading this blog

http://blog.roozbehk.com/post/351568...dd-network-eth

and it says to RUN this command,

# cd /etc/sysconfig/network-scripts/

but when I do, it opens a BLANK SCREEN with INSERT on the bottom

then I try

vi ifcfg-eth0

( maybe that one was the black screen with insert )

I also get a line that says "NEWFILE"


How do I go from here?

What am I missing

Thanks in advance,

rknichols 07-12-2016 11:20 AM

The "#" is the root prompt. Don't type that, it makes that whole line a comment. When you then try to edit the file, you are in the wrong directory, where there is no existing file with that name.

Joseph2016 07-12-2016 11:55 AM

Quote:

Originally Posted by rknichols (Post 5574684)
The "#" is the root prompt. Don't type that, it makes that whole line a comment. When you then try to edit the file, you are in the wrong directory, where there is no existing file with that name.

hI

Thank you, I am not typing the #

and I an getting [newfile]

What does that mean?

Thanks in advance

suicidaleggroll 07-12-2016 12:05 PM

Please post the output of the following:
Code:

ls -l /etc/sysconfig/network-scripts/
and
Code:

ifconfig -a

Joseph2016 07-12-2016 01:45 PM

the first command

ls -l

https://s32.postimg.org/pfnxnxy1x/ls_l.jpg




The second command ifconfig -a

No command found

Thank you for all of your help!

suicidaleggroll 07-12-2016 02:07 PM

Looks like your ethernet adapters are called "eno1" and "eno2" rather than "eth0", so those are the files you'll want to edit. Which one to edit depends on which port your ethernet cable is attached to.

I thought CentOS 6 came with net-tools installed by default? Are you sure this isn't CentOS 7? "eno1" is also a CentOS 7 style name. You can verify the distro with:
Code:

uname -a
and/or
Code:

cat /etc/*release*

michaelk 07-12-2016 02:17 PM

As a regular user you need to specify the complete path i.e.
/sbin/ifconfig

However, the ifconfig command is being deprecated and replaced by the ip command. You can see the same information although in a different format

ip a


You indicate that you installed CentOS 6 but from the posted image it looks like CentOS 7. Predictive names en01 and en01 replaced eth0 and eth1. You will find there are a lot of websites that have outdated information since version 7 has some major changes since 6.

If running a desktop the easiest method would be to use networkmanager applet at the upper right or the nmtui.

Joseph2016 07-12-2016 02:29 PM

Quote:

Originally Posted by suicidaleggroll (Post 5574820)
Looks like your ethernet adapters are called "eno1" and "eno2" rather than "eth0", so those are the files you'll want to edit. Which one to edit depends on which port your ethernet cable is attached to.

I thought CentOS 6 came with net-tools installed by default? Are you sure this isn't CentOS 7? "eno1" is also a CentOS 7 style name. You can verify the distro with:
Code:

uname -a
and/or
Code:

cat /etc/*release*


Oh man, It is 7 . I meant to install 6..

Will Centos 7 work with cpanel and if not how do I default to 6?

Thank you for all the help

How do I change the eth0?

Joseph2016 07-12-2016 02:30 PM

Quote:

Originally Posted by michaelk (Post 5574832)

If running a desktop the easiest method would be to use networkmanager applet at the upper right or the use nmtui.


I have this on a DELL 1920 QUAD core web server and trying to set up my first web server

Thanks for the help and how do I change the ETH0?

YOU were right . its 7 ;)

suicidaleggroll 07-12-2016 02:42 PM

No idea about cpanel, you'd have to look at their documentation. You would need to download the ISO for CentOS 6 and reinstall if you want to switch.

You don't have an eth0, you have eno1 and eno2, those are your two ethernet ports on the server, and ifcfg-eno1 and ifcfg-eno2 are their configuration files.

Joseph2016 07-12-2016 02:42 PM

Will this work?

/sbin/ip link set eno1 down
/sbin/ip link set eno1 name eth0
/sbin/ip link set eth0 up

suicidaleggroll 07-12-2016 02:44 PM

Why do you want it to be called eth0? Do you have some program or something that has "eth0" hard-coded into it and your network interface has to match? If not, just leave it at the default name or you'll likely break something.

Joseph2016 07-12-2016 02:46 PM

Quote:

Originally Posted by suicidaleggroll (Post 5574860)
Why do you want it to be called eth0? Do you have some program or something that has "eth0" hard-coded into it and your network interface has to match? If not, just leave it at the default name or you'll likely break something.

I don't want it to be called anything in particular

I am just asking for help or a command line that will fix my problem

Thank you and so sorry for my misspeaking

Joseph2016 07-12-2016 02:48 PM

so like this ?

Thank you for all the help ;)

/sbin/ip link set eth1 down
/sbin/ip link set eth1 name eno1
/sbin/ip link set eno1 up

is that correct?

michaelk 07-12-2016 02:48 PM

I assume network manager is installed and running. If nmtui does not work will do it manually.

http://www.krizna.com/centos/setup-network-centos-7/


All times are GMT -5. The time now is 10:55 AM.