CentOS7 ip address configuration

 

1. Check the network profile

Probably because of the different systems, the configuration file is different, in general, the configuration files are prefix: ifcfg-eno + suffix: of random numbers

Into the / etc / sysconfig / network-scripts directory, and by the ls command to view the network profile, generally the first one is.

$ cd /etc/sysconfig/network-scripts
$ ls

 

2. Edit the ifcfg-eno profile

Amended as follows red marker place

$ vi ifcfg-eno16777736

Configuration instructions:

BOOTPROTO: Be sure to set as static, or after you configure through ifconfig to view, two IP addresses will appear;

GATEWAY: If CentOS is running on VMware, the gateway can "edit - Virtual Network Editor --NAT Settings" to see to;

HWADDR: MAC address can be viewed through the command ip addr

 

[root@localhost ~]# ip addr
1: lo:
    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 forever

2: eno16777736:
    link/ether00:0f:19:10:12:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.38.135/24 brd 192.168.38.255 scope global dynamic eno16777736
       valid_lft 1681sec preferred_lft 1681sec
    inet6 fe80::20c:11aa:ae11:4fe4/64 scope link
       valid_lft forever preferred_lft forever

Red font 0f: 19: 10: 12: f1 is the MAC address

 

3. Restart card

$ service network restart  

If the configuration is successful in ..ok said that if ..failed appear, it is likely that HWADDR configuration problem.

 

4.ping test

 

Guess you like

Origin www.cnblogs.com/caoxb/p/11257528.html