LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-25-2012, 11:53 AM   #1
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Rep: Reputation: Disabled
No file for eth0


Dear experts,

I installed CentOS into my laptop's harddisk while detaching it from laptop and connecting it to my server via USB cable. The CentOS is installed and when i plug the harddisk back to my laptop, it simple started working.

The problem is that
Code:
/etc/sysconfig/network-scripts
has entries

Code:
ifcfg-em1,ifcfg-em2, ifcfg-em3, ifcfg-em4
which are the 4 gigabit interfaces on my server, now as i put this harddisk into my laptop and plugged network cable, tough it started working but I am unable to find ifcfg-eth0 in network-scripts directory.

The ifconfig shows
Code:
eth0
which successfully obtains IP from one of my dhcp servers in my LAN.

I dont want dynamic IP and am unable to find ifcfg-eth0 so I configure it with my required IP. I tried
Quote:
find /etc -name "*eth0"
but couldnt locate the file. I guess its in running configuration.

What can I do to have ifcfg-eth0 so i configure it with my required IP.

Regards.

Last edited by sudo_su; 12-25-2012 at 11:56 AM.
 
Old 12-25-2012, 12:06 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,136
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Have you tried the network config tool system-config-network
http://www.centos.org/docs/5/html/De...nterfaces.html
http://www.centos.org/docs/5/html/De...rk-config.html
 
Old 12-25-2012, 12:10 PM   #3
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
Quote:
Originally Posted by sudo_su View Post
Dear experts,

I installed CentOS into my laptop's harddisk while detaching it from laptop and connecting it to my server via USB cable. The CentOS is installed and when i plug the harddisk back to my laptop, it simple started working.

The problem is that
Code:
/etc/sysconfig/network-scripts
has entries

Code:
ifcfg-em1,ifcfg-em2, ifcfg-em3, ifcfg-em4
which are the 4 gigabit interfaces on my server, now as i put this harddisk into my laptop and plugged network cable, tough it started working but I am unable to find ifcfg-eth0 in network-scripts directory.

The ifconfig shows
Code:
eth0
which successfully obtains IP from one of my dhcp servers in my LAN.

I dont want dynamic IP and am unable to find ifcfg-eth0 so I configure it with my required IP. I tried but couldnt locate the file. I guess its in running configuration.

What can I do to have ifcfg-eth0 so i configure it with my required IP.

Regards.
this is not a problem. are you confused after seeing ifcfg-em* files

So FYI

Ethernet NICs embedded on the motherboard will be named em[1234] rather than ethX. PCI add-in card NICs will be named p<slot>p<port>_<vf>.

Linux guests running under virtualization platforms such as KVM, Xen, VMware Workstation or ESX, or Microsoft Hyper-V will not have their devices renamed.

Reference-
http://fedoraproject.org/wiki/Featur...rkDeviceNaming

Last edited by sharadchhetri; 12-25-2012 at 12:26 PM.
 
Old 12-25-2012, 12:21 PM   #4
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Original Poster
Rep: Reputation: Disabled
Here they are,

(1) ls -l /sys/class/net/
Quote:
total 0
lrwxrwxrwx. 1 root root 0 Dec 25 10:30 eth0 -> ../../devices/pci0000:00/0000:00:19.0/net/eth0
lrwxrwxrwx. 1 root root 0 Dec 25 10:30 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx. 1 root root 0 Dec 25 10:30 virbr0 -> ../../devices/virtual/net/virbr0
lrwxrwxrwx. 1 root root 0 Dec 25 10:30 virbr0-nic -> ../../devices/virtual/net/virbr0-nic
lrwxrwxrwx. 1 root root 0 Dec 25 10:30 wlan0 -> ../../devices/pci0000:00/0000:00:1c.1/0000:10:00.0/net/wlan0
(2) ls -l /etc/udev/rules.d/

Quote:
total 64
-rw-r--r--. 1 root root 6858 Jul 19 2011 40-hplip.rules
-rw-r--r--. 1 root root 706 Jul 19 2011 56-hpmud_support.rules
-rw-r--r--. 1 root root 1652 Nov 12 2010 60-fprint-autosuspend.rules
-rw-r--r--. 1 root root 4171 Nov 11 2010 60-openct.rules
-rw-r--r--. 1 root root 1060 Nov 12 2010 60-pcmcia.rules
-rw-r--r--. 1 root root 316 Nov 5 15:21 60-raw.rules
-rw-r--r--. 1 root root 1216 Dec 25 2012 70-persistent-cd.rules
-rw-r--r--. 1 root root 590 Dec 25 2012 70-persistent-net.rules
-rw-r--r--. 1 root root 40 Dec 18 13:48 80-kvm.rules
-rw-r--r--. 1 root root 320 May 9 2012 90-alsa.rules
-rw-r--r--. 1 root root 83 Jul 19 2011 90-hal.rules
-rw-r--r--. 1 root root 53 Dec 8 2011 91-drm-modeset.rules
-rw-r--r--. 1 root root 292 Dec 10 19:53 98-kexec.rules
-rw-r--r--. 1 root root 54 Dec 8 2011 99-fuse.rules
(3) lspci|grep -i eth
Quote:
00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)
(4) cat /etc/sysconfig/network-scripts/ifcfg-em1

Quote:
EVICE="em1"
BOOTPROTO="dhcp"
HWADDR="BC:30:5B3B:B0"
NM_CONTROLLED="yes"
ONBOOT="no"
TYPE="Ethernet"
UUID="0e1d62d9-2d16-4445-9088-155d46e7c3d5"
 
Old 12-25-2012, 12:23 PM   #5
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Original Poster
Rep: Reputation: Disabled
Lolz for my HWADDR that changed into smilies
 
Old 12-25-2012, 12:48 PM   #6
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Original Poster
Rep: Reputation: Disabled
@sharadchhetri

sorry may be i am not getting you but my question still is,

1: Why is my ifconfig showing entries for eth0?

2: How can I assign static IP to my ethernet as i dont have conf file for it in my /etc.

The onez that i got i.e ifcfg-em1, I tried on them but they are not working.
 
Old 12-25-2012, 01:08 PM   #7
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
Quote:
Originally Posted by sudo_su View Post
@sharadchhetri

sorry may be i am not getting you but my question still is,

1: Why is my ifconfig showing entries for eth0?

2: How can I assign static IP to my ethernet as i dont have conf file for it in my /etc.

The onez that i got i.e ifcfg-em1, I tried on them but they are not working.
(1) Take the backup of these files first*****And move to new directory**********
mkdir -p /root/backup
mv /etc/sysconfig/network-scripts/ifcfg-em1 /root/backup
mv /etc/udev/rules.d/70-persistent-net.rules /root/backup

(2) cp -p /etc/grub.conf /root/backup/grub.conf.bak

edit /etc/grub.conf
give "biosdevname=0" on the kernel command line (rhgb quiet biosdevname=0)

if you are not sure, paste grub.conf

Step 3:

create ifcfg-eth1 file

DEVICE="eth1"
BOOTPROTO="none"
HWADDR="paste the MAC if you are seeing in ifcfg-em1"
NM_CONTROLLED="no"
IPADDR=192........
NETMASK=255.......
GATEWAY=192.....
ONBOOT="no"
TYPE="Ethernet"

NOTE: ONBOOT="no" because we are troubleshooting here. you have to up the eth by command ifup-eth1


Restart the system

paste its output also /etc/udev/rules.d/70-persistent-net.rules

Last edited by sharadchhetri; 12-25-2012 at 01:13 PM.
 
  


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
vnStat - if pointed to eth0 will it aggregate eth0 and eth0:1 alias stardotstar Linux - Networking 0 07-20-2010 07:49 PM
where information is saved from eth0,?in which file? bushra Linux - Networking 5 02-14-2010 09:48 AM
Questions about ifcfg-eth0 file veeruk101 Linux - Networking 2 07-23-2007 07:08 PM
SIOCADDRT: File exists SIOCCADDRT: File Exists Failed to bring up eth0. opsraja Linux - Networking 0 01-10-2005 08:29 AM
What is eth0.route file? ebreiter Linux - Networking 1 09-09-2004 05:35 AM

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

All times are GMT -5. The time now is 09:33 PM.

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