How to determine which physical interface corresonds to eth0, eth1, eth2, and eth3
What is the best way to dermine which physical interface corresponds to eth0, eth1, eth2, and eth3 on a server with 4 ethernet ports? It seems like eth0 sometines refers to one interface and upon a reboot in conjunction with a cable swap eth0 now corresponds to another interface. Is there a command that will say eth0 is the Broadcom or eth0 is port 1 on the PCI dual NIC Intel card, etc.
Thanks - John |
I would somewhere there would be references to MAC addresses on the hardware and from that compare output to ifconfig -a. If say all on a single card normally I would say the docs of the hardware point out which port is first, second, thrid and so on. If MAC are sequencal then the lowest normally goes to eth0 and so on.
Brian |
I'm going to quote another thread on a similar subject :
Quote:
|
Hi,
Quote:
|
Thanks for the information
This helps - appreciate it.
A little more background as to what I was doing. I just installed Slakware 12 and I have 4 ethernet ports all connected to a switch. Let's say each port is in the same VLAN. Then I config eth0 and can ping it from a different host in the same subnet. Now I want to introduce VLANs into the scenario in order to put the other interfaces in different subnets for some testing with tcpreplay I plan to do. First I scratch my head and say okay which int is actually eth0. I figure I will do a continuous ping and pull each cable one at a time until the ping is interupted. This did not work as easily as I thought it would, as the ping would stop even when I pulled a cable on one of the other 3 unconfigured ports, and was slow to restart when I restored cables.???? The bottom line is it sounds like if I know what MAC address corresponds to each physical interface I can assign the label assigned to those ports, and this label is used in commands like ifconfig, etc. This assignment occurs in the file in the response to my initial post. Those associations are stored in the folder /etc/udev/rules.d/ where you will find a "yx_persistent-net.rules" file ("yx" are random numbers, depends on your system). Now getting the MAC address for each physical port and knowing which port it actually is may require an empirical approach if I do not have documentation on this. I could configure one at a time and determine the MAC address of each. Once assigned does the label stay attached to the physical interface for subsequent boots? Even if I remove a cable or two and perhaps switch others? While I was testing it appeared eth0 was jumpoing around between the 4 interfaces. Finally, can you tell me the command to stop and restart the network service? Thanks - appreciate all the help. |
Hi,
The card will physically have the MAC address assignment indicated on the PCB. The MAC is assigned to the manufacture ID. Your '/etc/udev/rules.d/75-network-devices.rules' will have the assignments for the kernel. Just pulling the cable will not get you anywhere, causes other problems. You can use the '/etc/rc.d/rc.inet1 'start/restart/stop' to control the inet. |
All times are GMT -5. The time now is 03:53 PM. |