Seven useful command line tools for Linux network configuration (1)

Source: Internet
Author: User

BKJIA: although most Linux distributions now have GUI Network Management configurations, it is helpful to be familiar with command line tools. Let's take a look at the common commands below these popular Linux distributions. By the way, if you want to know the details of the tool and options, you can enter man and enter the Tool Name to access its man page.

BKJIA recommended for editing: Linux monitoring tools

Open your terminal now and try it!

Ifconfig for basic interface and IP configuration

Ifconfig tool interface configurator (interface configurator) provides some basic but important functions. It can turn on and off the network adapter and assign the IP address and netmask information. Some Common commands are as follows:

View the current configuration of the network interface and the interface Name:

Ifconfig

Open up) or close down) Adapter

Ifconfig <Network Name> <up | down>

Assign an IP address to the adapter:

Ifconfig <Network Name> <IP address>

Assign a second IP address to the adapter:

Ifconfig <Network Name: number of instances> <IP address>

Example: ifconfig eth0: 0 192.168.1.101

Detailed introduction: ifconfig for Linux Command Network Operations

Ethtool used to manage the Ethernet Card

Ethtool allows you to view and modify the various settings of the Ethernet Adapter, excluding Wi-Fi Nic), including tx/rx, checksumming, and wake-on-LAN Settings. The following are some useful commands:

Display the driver information of a network adapter, which is suitable for querying software compatibility:

Ethtool-I <Interface Name>

Display network data:

Ethtool-S

Set the adapter connection speed (Mbps)

Ethtool speed <10 | 100 | 1000>

Detailed introduction: Ethtool for Linux/Unix Commands

Configure the wireless network in iwconfig

Iwconfig can be regarded as ifconfig and ethtool of the wireless network adapter. You can check basic Wi-Fi network settings, such as SSID, channel, and encryption. You can also modify some advanced settings, including the receipt sensitivity, RTS/CTS, fragments, and number of retries. The following describes several useful commands:

Display the current wireless settings, including the Interface Name:

Iwconfig

Set the ESSID extension service to set the identifier) or network name:

Iwconfig <Interface Name> essid <Network Name>

Example: iwconfig <Interface Name> "my network"

Example: iwconfig <Interface Name> any

Set radio Wireless channel1-11 ):

Iwconfig <Interface Name> <channel>

The entered WEP encryption keys WPA and WPA1 are not yet supported and need the support of wpa_supplicant ):

Iwconfig eth0 key <key in HEX format>

Restrict the adapter to connect to the AP only at the specified MAC address:

Iwconfig <Interface Name> ap <mac address>

Example: iwconfig eth0 ap 00: 60: 1D: 01: 23: 45

Sets the launch intensity of radio, which is only valid when the wireless Nic supports it. The default unit is dBm, which can be set to mW:

Iwconfig <Interface Name> txpower <strength>

Example: iwconfig eth0 txpower 15

Example: iwconfig eth0 txpower 30 mW

Detailed explanation: Linux operating system wireless network commands


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.