Linux Ifconfig
hi guys when i type the command, cat /etc/network/interfaces it will show this result:
Quote:
Quote:
why the eth2 comes into play when there is already a static IP defined? thank you for any input. :) |
Do you have only one ethernet device? Did you happen to replace the network card recently?
|
Please provide the output of /etc/udev/rules.d/70-persistent-net.rules.
Just a hint. Maybe try the ip binary. It like it far better than ifconfig. ip link - shows all interfaces ip addr - shows ip addres of all interfaces ip route - shows active rules man ip - well the man page. |
only one interface on the pc.
I recently clone a server and restore the image on a pc. I don't know whether turning off the DHCP on linux will help. I'm using Ubuntu. |
Quote:
Udev is the reason this will happen, provide the output of: - cat /etc/udev/rules.d/70-persistent-net.rules - ip link list - dmesg | grep "eth[0-9]: addr" |
Let me try to explain. UDEV is a program on your linux that tries to keep the name of your network interfaces consistent. It does this by reading the NIC's mac address and creates a rule inside /etc/udev/rules.d/70-persistent-net.rules file. So next time a computer boots it will read this file and set the interface names accordingly. Each time a new network device is detected, a new name will be generated for it. Since you cloned the OS, the udev detected that a new hardware is present, thus giving the NIC a new name - eth2. The interfaces eth0 and eth1 are locked to their mac addresses. Of course these interfaces will not be present ever again, but udev doesn't know that.
So the solution for you is to edit out the /etc/udev/rules.d/70-persistent-net.rules file, and remove any references to eth0 and eth1. Finally rename the 3rd entry from eth2 to eth0 and reboot. |
there is no /etc/udev/rules.d/70-persistent-net.rules
i can't find it any ideas guys? where to find eth2 and put back eth0 interface? |
Quote:
- Fix Missing eth0 When Cloning Ubuntu VMware Virtual Machines Maybe this link might help to recover it: - How to regenerate the /etc/udev/rules.d/70-persistent-net.rules file on Debian/Ubuntu |
hi druuna, this not a latest version of Ubuntu.
It's Feisty Ubuntu 7.04, actually, i created manually the 70-persistent-net.rules but no joy. The original server, I had checked also it doesn't have this 70-persistent-net.rules. Where does Linux keeps it new find hardware devices? is there some sort of a conf file that it keeps its data for newly find devices such as NIC? Thanks for any input. :) |
Quote:
Underlying problem is still the same though: Hardware address of the network interface was changed due to cloning. I don't have a clue how (very) old Ubuntu version might have handled this. |
thanks for the reply, new version is handled by 70-persistent-net.rules.
But for sure, 6 year old distro has a way of handling it. But might just be in a different way. One thing I have in mind, is to rename the info on /etc/network/interfaces because the info on /etc/network/interfaces is still the old info from the clone server. while i'm typing this, something cross my mind. The MAC on /etc/network/interfaces is still the old MAC of the server. But I had shutdown the machine so I can't connect remotely but hope this idea will work. If you have any ideas on mind guys, please spit it out and help me. Thanks for any ideas. I will update this post if changing the MAC on /etc/network/interfaces will help. :) |
If it's a VM couldn't you change the MAC of the virtual network card to match what it was on the old instance, or am I missing something?
|
hi 273, i restored it to a PC.
what i mean by changing the MAC, i'm not changing the MAC physically on the NIC itself. But what I mean is is change the text file on /etc/network/interfaces. I don't know whether this will work, or how does the old distro or Linux remember different NIC? Because everyone is talking about 70-persistent-net.rules, which the old distro don't have. There should be some sort of a database file (if that's the right term) on Linux, when the NIC is change or any hardware. System is smart to remember different hardware and will use different name. Like the NIC for example since it's a different NIC and eth0, eth1 was used by the old machine, and on the machine in which I restored the distro Linux change to eth2 since it's a different hardware and eth0 and eth1 was used before already. And I presume if I will load back this image to the original machine, the NIC will automatically change to eth0 since the distro is able to detect the original hardware. |
Quote:
Thanks for all the help guys :) |
All times are GMT -5. The time now is 04:09 AM. |