Linux OS ifconfig Command detailed resolution

Source: Internet
Author: User

Whether it's a Linux installation or a manual installation, Linux asks you questions about the network and configures the relevant software. The basic command for configuring the NIC is Ifconfig.

After the ifconfig command is executed, the system will set the necessary parameters in the kernel table so that Linux knows how to communicate with the NIC on the network. The Ifconfig command has the following two formats:

※ifconfig [Interface]

※ifconfig interface [aftype] option | Address ...

The first format of the ifconfig (or the ifconfig command with no arguments) can be used to view the network configuration of the current system.

After the system has just been installed, Linux is actually used without a NIC or network connection, but the ifconfig can be used to work in a wrapping way so that the computer thinks that it is working on the network.

Now let's run the Ifconfig command, and the Ifconfig command with no parameters can display the currently initiated network interface with the following output:

[Root@machine1/sbin] #ifconfig

Eth0 Link encap:ethernet hwaddr 52:54:ab:dd:6f:61

inet addr:210.34.6.89 bcast:210.34.6.127 mask:255.255.255.128

Up broadcast RUNNING multicast mtu:1500 metric:1

RX packets:46299 errors:0 dropped:0 overruns:0 frame:189

TX packets:3057 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:100

Interrupt:5 Base Address:0xece0

Lo Link encap:local Loopback

inet addr:127.0.0.1 mask:255.0.0.0

Up loopback RUNNING mtu:3924 metric:1

RX packets:44 errors:0 dropped:0 overruns:0 frame:0

TX packets:44 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

The eth0 is led by the part of the Ethernet card configuration parameters, which shows the network card under the device name/dev/eth0 and hardware of the MAC address 52:54:ab:dd:6f:61,mac address is a manufacturer set, each network card has the only address.

However, we can manually change the MAC address of the NIC, as long as we add in the network in/etc/rc.d/init.d/:

ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

Then restart, and then use the Ifconfig command to view, we will find that the MAC address of the network card has become xx:xx:xx:xx:xx:xx.

Subsequent common network card IP settings method:

Set directly through Setup.

Configure multiple NIC ifconfig-a view network device Eth0/eth1/lo (loop).

Ifconfig eth1//equipment 1

Ifconfig eth1 192.168.1.10 netmask 255.255.255.0//Set Network clamp network and IP

Mans Ifconfig

Ifconfig--help (T002)

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.