Linux Basics (ii) network configuration, testing

Source: Internet
Author: User

Tag:existing    system administrator    

  1. View, modify host name

              hostname View host name, temporarily change hostname, permanently change host name vi/etc/sysconfig/network  Change the hostname field to the user's desired hostname save exit, for example:

    View host name

    650) this.width=650; "Src=" Https://s1.51cto.com/wyfs02/M02/8E/F6/wKiom1jP0vORLTPVAAAbR4dGRx0232.png-wh_500x0-wm_3-wmp_4-s_1891918290.png " Title= "Qq20170320210226.png" alt= "wkiom1jp0vorltpvaaabr4dgrx0232.png-wh_50"/>
    temporarily modify host name

    650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/m00/8e/f6/wkiom1jp02gc6r4xaaayattckl0145.png-wh_500x0-wm_3- Wmp_4-s_3450685338.png "title=" temporarily modifies. png "alt=" wkiom1jp02gc6r4xaaayattckl0145.png-wh_50 "/>

    Permanently modifies host name (VI/ etc/sysconfig/network) Change hostname

    650) this.width=650; src= https://s3.51cto.com/wyfs02/M02/8E/F4/ Wkiol1jp0_2gtds0aaamzgsa_tk278.png-wh_500x0-wm_3-wmp_4-s_1314386848.png "title=" QQ20170320210702.png "alt=" Wkiol1jp0_2gtds0aaamzgsa_tk278.png-wh_50 "/>

    can be changed with hostname  host name to take effect   No restart required

  2. Network configuration

    1. Modify the configuration file, the permanent effect vi/etc/sysconfig/network-scripts/ifcfg-eth0

    650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8E/F6/wKiom1jP2Eegxd5qAAAYM139uug038.png-wh_500x0-wm_ 3-wmp_4-s_1682382835.png "title=" IP result. png "alt=" wkiom1jp2eegxd5qaaaym139uug038.png-wh_50 "/>

Device=eth0 for Device name

Onboot=no for boot from

Bootproto=static how the network obtains IP

IPADDR, netmask,gateway,dns1 This is the IP address, subnet mask, gateway, domain name these are all must exist

TYPE,HWADDR, respectively, is the network type and MAC address, and then save to exit the restart service.

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/8E/F4/wKioL1jP2prBBqBgAAAjr1_7k00938.png-wh_500x0-wm_ 3-wmp_4-s_1685847524.png "title=" Restart Service, query Ip.png "alt=" Wkiol1jp2prbbqbgaaajr1_7k00938.png-wh_50 "/>

2. Temporarily modify the IP address can be queried via ifconfig network, or can be temporarily modified by ifconfig IP address

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8E/F6/wKiom1jP2wfjDFgaAAAvf3pYAPo254.png-wh_500x0-wm_ 3-wmp_4-s_95217226.png "title=" temporarily modified Ip.png "alt=" Wkiom1jp2wfjdfgaaaavf3pyapo254.png-wh_50 "/>

3.ifconfig network card device name down/up network card disabled and enabled, IFDOWN/IFUP network card disabled and enabled

4. Network configuration via setup, sometimes it is necessary to install setup and its components for management.

3. Network Testing

ping command simple test network connectivity

Netstat detection network configuration-a show all connections-T TCP Transport protocol connectivity status-U UDP transport Protocol connectivity status, etc.

Traceroute Route Tracking

Nslookup test Domain name resolution

Ifconfig Viewing network IP

Linux Basics (ii) network configuration, testing

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.