Home>

I'm new to networks.
I would like to confirm my knowledge.

For L2 switches and routers, such as "Gigabit Ethernet" and "Fast Ethernet"
You have an interface, right?

For example, when connected to an L2 switch by wire
How can I check the interface of the PC (host)? (Eth0 and ens33 ...?)

I'm investigating, but I didn't understand much.
Are eth0 and ens33 a wired interface for PCs?

I'm sorry if you asked a strange question.

  • Answer # 1

    Is the question that you do not know the connection between the interface recognized on the OS and the actual physical interface (port or antenna)? We'll assume that's the question, but if it's not, ignore this answer.


    If you have only one interface, you will only see one network interface on your OS. In that case, it must be the only one.

    However, if you have multiple interfaces, you won't immediately know which one.

    First, the name given to the interface may differ depending on the type of interface (wired or wireless). What kind of name is given depends on the OS, so it cannot be said unconditionally, but if it is wireless, it may be named as Wi-Fi or wlp, etc. Also, depending on the OS, you can distinguish by the icon (wireless is an antenna mark), or you can check the NIC (Networ Interface Controller) name (such as a chip made by Intel), so you can also distinguish by that. Let's do it. Even if you have multiple types of interfaces, if you have one for each, you will not be confused.

    * In addition to physically visible wired and wireless, there are also Bluetooth network interfaces and virtual network interfaces created by virtualized environments. However, most of these are known by their names.

    The problem is when you have more than one interface of the same type. What is commonly referred to as a server usually has multiple network interfaces. In most cases, it is stamped with LAN1 or LAN2. By the way, how these appear on the OS is like "eth0", "eth1", "Ethernet" and "Ethernet 2". If you think about it normally, it seems that the OS display order and the physical marking order are the same, that is, eth0 is LAN1 and eth1 is LAN2.That is not always the case.The physical markings are certainly in the order of placement, which is the correct order for hardware such as the BIOS. However, the order given by the OS is the order recognized by the OS, and the phenomenon that the hardware order and the recognition order are different may occur. In other words, eth0 may be LAN2 and eth1 may be LAN1. In this case, it's a bit tedious to know exactly which interface you have. For example, there are the following methods.

    Actually point to the LAN cable, link up only one, and check which is linked up on the OS.

    Compare the MAC address confirmed in the BIOS etc. with the MAC address confirmed on the OS.

    For the same model, they tend to be in the same order. However, there are usually cases where different OSs are different, that is, Windows is in order and RHEL is in reverse order. If it is the same model, it is better not to think that they are all the same.

    In addition, it seems that a similar phenomenon may occur even in the case of a virtual machine (although I have never had it), so the order should not be swallowed. It is recommended to recognize the addition of virtual network interfaces to virtual machines one by one.