LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-12-2016, 10:53 AM   #1
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Rep: Reputation: Disabled
# 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,
 
Old 07-12-2016, 11:20 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
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.
 
1 members found this post helpful.
Old 07-12-2016, 11:55 AM   #3
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
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
 
Old 07-12-2016, 12:05 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Please post the output of the following:
Code:
ls -l /etc/sysconfig/network-scripts/
and
Code:
ifconfig -a
 
1 members found this post helpful.
Old 07-12-2016, 01:45 PM   #5
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
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!

Last edited by Joseph2016; 07-12-2016 at 01:46 PM.
 
Old 07-12-2016, 02:07 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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*
 
Old 07-12-2016, 02:17 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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.

Last edited by michaelk; 07-12-2016 at 02:35 PM.
 
Old 07-12-2016, 02:29 PM   #8
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
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?
 
Old 07-12-2016, 02:30 PM   #9
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post

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
 
Old 07-12-2016, 02:42 PM   #10
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
1 members found this post helpful.
Old 07-12-2016, 02:42 PM   #11
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
Will this work?

/sbin/ip link set eno1 down
/sbin/ip link set eno1 name eth0
/sbin/ip link set eth0 up
 
Old 07-12-2016, 02:44 PM   #12
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
Old 07-12-2016, 02:46 PM   #13
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
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
 
Old 07-12-2016, 02:48 PM   #14
Joseph2016
LQ Newbie
 
Registered: Jul 2016
Location: New York
Distribution: Centos
Posts: 22

Original Poster
Rep: Reputation: Disabled
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?
 
Old 07-12-2016, 02:48 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/sysconfig/network-scripts/ifcfg-eth0 and 1 being rewritten on reboot smcracraft Linux - General 2 05-27-2012 01:19 AM
How to add default gateway in /etc/sysconfig/network-scripts/* zamri Linux - Networking 2 09-06-2005 10:32 AM
How to change /etc/sysconfig/network-scripts/ifcfg-eth0 ariana Linux - Networking 1 05-01-2005 01:37 PM
can anyone post their /etc/sysconfig/network-scripts/ifcfg-wlan0? Dooberdoink Linux - Wireless Networking 1 03-27-2005 09:49 AM
/etc/sysconfig/network-scripts on Solaris? meshcurrent Solaris / OpenSolaris 6 11-24-2002 01:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration