Linux Network Interface literacy

Source: Internet
Author: User

(1) Name of the Network Interface

There are no naming rules, but the definition of network interface names is generally meaningful. For example:

Eth0: Abbreviation of Ethernet, which is generally used for Ethernet interfaces.

Wifi0: Wi-Fi is a wireless LAN, so wifi0 generally refers to a wireless network interface.

ATH0: Short for atheros, generally refers to the wireless network interface contained in the atheros chip.

Lo: Short for local, generally refers to the local loopback interface.

(2) How Network Interfaces work

Network interfaces are basic devices used to send and receive data packets.

All network interfaces in the system constitute a chain structure, which is called by name when the application layer program is used.

Each network interface corresponds to a struct net_device struct in Linux, including name, Mac, mask, MTU... Information.

Each hardware NIC (a Mac) corresponds to a network interface, and its work is completely controlled by the corresponding driver.

(3) Virtual Network Interface

Virtual Network Interfaces are widely used. The most famous one is "Lo". Basically, each Linux system has this interface.

The Virtual Network Interface does not actually receive and send data packets from the outside world, but receives and sends data packets within the system. Therefore, the virtual network interface does not need a driver.

The virtual network interface and the real network interface are used in the same way.

(4) create a network interface

The network interface of the hardware Nic is created by the driver. The virtual network interface is created by the system or by the application layer program.

The function used to create the network interface in the driver is register_netdev (struct net_device *) or register_netdevice (struct net_device *).

The difference between the two functions is: register_netdev (...) The interface named "eth" is automatically generated, while register_netdevice (...) You need to specify the interface name in advance. In fact, register_netdev (...) Also by calling register_netdevice (...) .

2. Lo (loopback interface) in Linux)

1) What is the lo interface?

In Linux, besides the network interface eth0, you can also have other interfaces, such as LO (local loop interface ).

2) What is the role of the LO interface?

If a package is generated by a local process as another local process, it will go through the 'lo' interface of the outbound chain and then return the 'lo' interface that enters the chain. for details, refer to the related content of the package filter.

Part2 experiment:

A local process initiates a connection to port (8085) of the Intranet IP address (eth1: 10.1.1.1) monitored by a local daemon. At this time, packets cannot be captured on eth1, the local loopback interface Lo is used, while the IP address at the network layer is an intranet IP address.

Link: http://linux.chinaitlab.com/admi...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.