Linux System Management-(-CENTOS7) network configuration

Source: Internet
Author: User

Because the network configuration of Centos7 has a large gap with previous versions, it is discussed separately.

Centos 7 has automatic detection capability for network card devices:

      (1) network card naming mechanism
            systemd naming network devices:
                 (a) if the index information provided by the firmware or BIOS integrated devices on the main board is available, And can be predicted based on this index name, such as Eno1;
                 (b) If the index information provided by the firmware or BIOS for the PCI-E expansion slot is available and predictable, it is named according to this index, such as ens1;
                 (c) If the physical location information of the hardware interface is available, it is named according to this information, For example Enp2s0;
                 (d) If the user explicitly starts, it can also be named according to the MAC address , ENX2387A1DC56;
                 (E) When none of the above is available, use the traditional naming mechanism;

                 The above naming mechanism, some need to biosdevname program participation;

(2) Name composition format
En:ethernet Ethernet
Wl:wlan Wireless LAN
Ww:wwan Wireless Wan

Name Type:
O<INDEX>: Device index number of the integrated device;
S<slot>: index number of the expansion slot;
X<mac>: Name based on MAC address;
P<bus>s<slot>: enp2s1



        naming procedures for network card devices:
              First step:
                udev, auxiliary tools/ Lib/udev/rename_device,/usr/lib/udev/rules.d/60-net.rules
                 Read configuration file
             Step Two:
                biosdevname will be based on/usr/lib/udev/ Rules.d/71-biosdevname.rules

             Step three:
                 by detecting network interface devices, according to/usr/lib/udev/rules.d/75- Net-description
                     Id_net_name_onboard, Id_net_name_slot, Id_net_name_path

Return to the traditional naming method:
(1) Editing the/etc/default/grub configuration file
grub_cmdline_linux= "Net.ifnames=0 rhgb quiet"

(2) generate its configuration file for Grub2
Grub2-mkconfig-o/etc/grub2.cfg

(3) Rebooting the system


Address Configuration tool: Nmcli:

Display Network information: NMCLI device show [Dev Eth0]

Nmcli Con {show | up | | | add | modify | edit | delete | reload | load}

How to modify properties such as IP address:
#nmcli Connection Modify Interface name [+|-]setting.property value
Setting.property:
Ipv4.addresses
Ipv4.gateway
Ipv4.dns1
Ipv4.method
Manual

Network Interface Configuration TUI tool: Nmtui
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/72/AC/wKiom1Xq4lHRg_spAABcJWtj7z0097.jpg "title=" Nmtui.png "alt=" Wkiom1xq4lhrg_spaabcjwtj7z0097.jpg "/>

Host name Configuration tool: Hostnamectl
Status
Set-hostname



Linux System Management-(-CENTOS7) network configuration

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.