Linux under the ifconfig command extension practical

Source: Internet
Author: User

Linux View IP address command--ifconfig

Ifconfig command to view and change the address and parameters of a network interface

The code is as follows:

$ifconfig-A

lo0:flags=849 MTU 8232

inet 127.0.0.1 netmask ff000000

hme0:flags=863 MTU 1500

inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255

Ether 8:0:20:a7:4d:21

The system displays the name of the network interface, the state of the interface (up or down),

Interface IP address and mask information

To change the IP address of a network interface:

The code is as follows:

#ifconfig HME0 Down

#ifconfig HME0 211.101.149.233 netmask 255.255.255.0 up

First, use the down command parameter to HME0 the service of the network interface, and then use Linux to view the IP ifconfig command to

Interface to assign a new IP address and mask and start the network interface service

You can also change the IP address of the machine by changing the value of the IP address in the file/etc/hosts and restarting the system.

The code is as follows:

/etc/hosts/: 211.101.149.11 SAMPDT

Define host name in/ETC/HOSTNAME.HME0 and IP address.

Changed the NIC/Added network card, the system does not automatically start the interface service, you need to manually create the network port services:

The code is as follows:

#ifconfig HME0 Plumb

Linux view IP can be used to create a network port service for interface Le0

Accordingly, you can stop the service and shut down the network with the ifconfig with the Unplumb parameter.

Netconfig used to set IP addresses

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.