Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Extended use of ifconfig command under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the extended use of ifconfig command under Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "the extended use of the ifconfig command under Linux".

Linux command to check the IP address-- ifconfig

The ifconfig command is used 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 and the status of the interface (up or down)

Information such as IP address and mask of the interface

Change the IP address of the 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 temporarily stop the service of the network interface hme0, and then use Linux to view the ifconfig command of ip to

Interface assigns a new IP address and mask and starts the network interface service

You can also change the machine's IP address 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 hostname in / etc/hostname.hme0 and IP address.

The Nic has been changed / added, and the system cannot start the interface service automatically. In this case, you need to create the Nic manually:

The code is as follows:

# ifconfig hme0 plumb

Linux can create a network port service for the interface le0 by viewing ip.

Accordingly, using ifconfig with the unplumb parameter can stop the service and shut down the network.

Netconfig is used to set the IP address

At this point, I believe you have a deeper understanding of "the extended use of the ifconfig command under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report