Static IP settings for centos 7 Learning

Source: Internet
Author: User

This course is intended for centos 7.0.1406!


1. Edit the ifcfg-eth0 file, VIM is minimized when the installation is not installed, you need to install it on your own is not described.

# vim /etc/sysconfig/network-scripts/ifcfg-eth0

2. Modify the following content:

Bootproto = "static" # Change DHCP to static onboot = "yes" # enable this configuration at startup ipaddr = 192.168.7.106 # static ipgateway = 192.168.7.1 # Default Gateway netmask = 255.255.255.0 # subnet mask dns1 = 192.168.7.1 # DNS Configuration

3. modified results

#] # Cat/etc/sysconfig/network-scripts/ifcfg-eth0HWADDR = "00: 15: 5D: 07: F1: 02 "type =" Ethernet "bootproto =" static "# Change DHCP to static defroute =" yes "peerdns =" yes "peerroutes =" yes "ipv4_failure_fatal =" no "4256init =" yes ""Listen 6_autoconf =" yes "comment 6_defroute =" yes "comment 6_peerdns =" yes "comment 6_peerroutes =" yes "comment =" no "name =" eth0 "UUID =" bb3a302d-dc46-461a-881e-d46cafd0eb71 "onboot =" Yes "# enable ipaddr = 192.168.7.106 # static ipgateway = 192.168.7.1 # Default Gateway netmask = 255.255.255.0 # subnet mask dns1 = 192.168.7.1 # DNS Configuration

4. Restart the network service.

# service network restart

5. Check the modified results. centois 7 does not use ifconfig, but uses IP commands to view network information.

# ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00    inet 127.0.0.1/8 scope host lo       valid_lft forever preferred_lft forever    inet6 ::1/128 scope host        valid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000    link/ether 00:15:5d:07:f1:02 brd ff:ff:ff:ff:ff:ff    inet 192.168.7.106/24 brd 192.168.7.255 scope global eth0       valid_lft forever preferred_lft forever    inet6 fe80::215:5dff:fe07:f102/64 scope link        valid_lft forever preferred_lft forever

Static IP settings for centos 7 Learning

Related Article

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.