Centos7 配置静态IP

修改/etc/sysconfig/network-scripts/ifcfg-xxx

  1. BOOTPROTO="static" #dhcp改为static   
  2. ONBOOT="yes" #开机启用本配置  
  3. IPADDR=192.168.7.106 #静态IP  
  4. GATEWAY=192.168.7.1 #默认网关  
  5. NETMASK=255.255.255.0 #子网掩码  
  6. DNS1=192.168.7.1 #DNS 配置  

service network restart重启网络

猜你喜欢

转载自www.cnblogs.com/mingzhang/p/8972891.html