Linux Initialization configuration-----Network configuration

Source: Internet
Author: User

I. Setting up a Linux network

1) Set IP address at zero

Since CENTOS7 does not have the Ifconfig command by default, we first install net-tool so that we can use the Ifconfig command to view the IP address.

• Mount the System CD

[Email protected] ~]# mount/dev/cdrom/media/cdrom/

• Enter the CD-ROM installation package directory installation Net-tool

[Email protected] ~]# cd/media/cdrom/packages/

[Email protected] packages]# RPM-IVH net-tools-2.0-0.17.20131004git.el7.x86_64.rpm

Now we can use the Ifconfig command to set the 0 O'Clock IP address (does not take effect after reboot)

Let's look at the usage of ifconfig.

[Email protected] packages]# ifconfig-h
Usage:
Ifconfig [-A] [-v] [-s] <interface> [[<af>] <address>]

Here is an example

[Email protected] packages]# ifconfig eno16777736 192.168.1.1 255.255.255.0

Then check the IP address is 192.168.1.1

Note: Address will expire after restarting service

Two. Permanently modify the IP address (modify the network configuration file)

Nic configuration file in/etc/sysconfig/networ-script/ifcfg-NIC name

We use the VI editor to modify the contents of the content can be permanently modified

Finally restart the Network service

[root@localhost network-scripts]# systemctl Restart Network.service

If there is no error, the modification succeeds.

Linux Initialization configuration-----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.