How to View ip commands in Linux

Source: Internet
Author: User
Article title: commands for viewing ip addresses in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

I believe everyone knows a lot about how to view ip addresses in Linux. today I will introduce you to the urgent commands for Linux to view ip addresses for your reference. The following is a detailed introduction.

Ifconfig

Command for viewing IP addresses in Linux -- ifconfig

The ifconfig command is used to view and change the network interface address and parameters.

$ Ifconfig-

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 network interface name, interface status (up or down ),

Interface IP address, mask, and other information

Change the IP address of the network interface:

# Ifconfig hme0 down

# Ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up

First, use the down command parameter to temporarily stop the service of the network interface hme0, and then run the Linux command to view the ip address ifconfig

The interface allocates a new IP address and mask, and starts the network interface service.

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

/Etc/hosts/: 211.101.149.11 sampdt

Define the host name in/etc/hostname. hme0 and IP address.

If the NIC is changed or the NIC is added, the interface service cannot be started automatically. you need to manually create the Nic service:

# Ifconfig hme0 plumb

In Linux, you can view the ip address to create a network port service for the interface le0.

Correspondingly, ifconfig with the unplumb parameter can be used to stop the service and disable the network.

Netconfig is 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.