Centos7 Network Basic Network

Linux network basic network configuration method described

linux Profile

1. Network Profile

  vim  /etc/sysconfig/network-scripts/ifcfg-ens33

QQ picture 20190831111645.png


Every modification is completed, use the command make systemctl restart network configuration to take effect



2. Host Configuration file name

/etc/sysconfig/network


QQ图片20190831185440.png

     (1) / etc / sysconfig / network file NETWORKing the host can not connect to the network. 

     Under (2) Windows, within the same local area network can not be passed between the same host name. Requirements in the LAN can not have the same host name of the host. And in the Linux host in the LAN can have the same host name, such as default host name: localhost.localdomain. 

     You need to restart the computer after (3) modify / etc / sysconfig / network file host name to take effect. After can temporarily change the hostname using the hostname hostname command, restart the computer after failure. You can view the current hostname by the hostname command.  

4) can also be used hostnamectl set-hostname hostname to modify the host name to use the su command to take effect



3.DNS profile

  /etc/resolv.conf

QQ图片20190831185801.png



 4. The local host mapping file

/etc/hosts

QQ图片20190831190109.png



VMware network configuration parameters

(1) ifconfig view network state (can see the IP address and subnet mask, gateway, and DNS but can not see the address), you can temporarily set the IP address and subnet mask of a network card

(2) ifconfig IP network interface   temporarily set IP address (network interface using ifconfig: 0 IP can configure the virtual interface)

(. 3) Vim / etc / sysconfig / Network-scripts / ens33 the ifcfg-   permanent IP address is provided by modifying the configuration file

(4) ifconfig network interface up   open network interface

(. 5) the ifconfig network interface goes down off the network interface

(6) netstat query network status

image.png


(7) route routing table is equivalent to the netstat -r

QQ图片20190831191508.png


(8) nslookup [hostname or IP]    : parse domain name or IP address

(9) the ping [options] ip or domain name : detecting network conditions specified IP or domain name.



Dual NIC detailed steps

  1. Add card and two network cards connected devices are set to host only

  2. By modifying the configuration file ens33 set to a static address

  3. The ens33 configuration file copy and modify the file name

  4. Copy the file to modify the configuration information for the new card will replace the original information off the card (UUID number information could be deleted altogether, the system will automatically recognize)



Remote synchronization file

scp local file path of the user @ip: remote user file path to            the local file synchronization to the remote user (notice the other root password)

scp user @ip: remote user file path of the local path                  to the remote user to a local file synchronization (notice the other root password)



 

Guess you like

Origin blog.51cto.com/14469918/2434417