"Linux learning is not difficult" Linux Network Command (2): Ifconfig command to display and configure the network interface

Source: Internet
Author: User

27.2 "Linux learning is not difficult" Linux Network Command (2): Ifconfig command to display and configure the network interface


Use the Ifconfig command to display and configure network interfaces, such as setting an IP address, MAC address, activating or shutting down a network interface.

Command syntax:

Ifconfig [interface] [Options | IP Address]

The meanings of the options in the command are as shown in the table.

Options

option meaning

-A

Show status of all network interfaces

Netmask < Subnet mask >

set the subnet mask for a network device

Up

activates the specified network device

down

Close the specified network device

HW < type > < hardware address >

set the hardware address of this interface ( MAC address). Currently supported hardware types include ether(Ethernet),ax25 ( ampr ax.25),ARCnet, and netrom (ampr net/rom)


Example: Configure the IP address of the NIC eno16777736 and activate the device at the same time.

[Email protected] ~]# ifconfig eno16777736 192.168.0.2 netmask 255.255.255.0 up

Example: Configure the IP address of the alias device eno16777736:1 for the NIC eno16777736.

[Email protected] ~]# ifconfig eno16777736:1 192.168.0.3

Example: Activating the NIC eno16777736:1 device.

[Email protected] ~]# ifconfig eno16777736:1 up

Example: Check the configuration of the NIC eno16777736 device.

[Email protected] ~]# ifconfig eno16777736

Example: View all the network card devices.

[Email protected] ~]# ifconfig-a

Example: Turn off the NIC Eno16777736:1 device.

[Email protected] ~]# ifconfig eno16777736:1 down



This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .




Linux learning is not difficult "Linux Network Command (2): ifconfig command display and configure network interfaces

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.