Linux ifconfig command to configure IP addresses

Source: Internet
Author: User

Nic naming rules in Linux: eth0 and eth1. The first Ethernet Card and the second card. Lo is the loopback interface, its IP address is fixed to 127.0.0.1, And the mask is 8 bits. It represents your machine. The Java code ifconfig [Interface] www.2cto.com is used to view the information of the NIC. If you do not add a parameter to view information of all NICs and add the parameter eth0, it is used to view information about the NIC of eth0: line 1: Connection Type: Ethernet (Ethernet) HWaddr (hardware mac address) Line 2: IP address of the NIC, subnet, mask line 4: UP (indicating that the NIC is enabled) RUNNING (indicating that the network card is connected) MULTICAST (supports MULTICAST)
MTU: 1500 (maximum transmission unit): 1500 bytes under www.2cto.com is the statistics on the number of received and sent data packets and the number of bytes sent and received data. Configure the IP address of the NIC Java code ifconfig eth0 192.168.168.64 netmask 255.255.255.255.0 configure the IP address and subnet mask of 192.168.168.64 on eth0. Configure the hardware address of the NIC. Java code ifconfig eth0 hw ether xx: xx disable Nic eth0 Java code ifconfig eth0 down www.2cto.com enable Nic eth0 Java code ifconfig eth0 up enable Nic ifup | ifdown eth0
Author renhongchao

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.