Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.