配置静态IP并实现网络连接

  • View IP address
     
    [abelethan@cdh01 ~]$ ifconfig​
    配置静态IP并实现网络连接_第1张图片
  • Set static ip addr
    [root@cdh01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33​

       配置静态IP并实现网络连接_第2张图片

  • Restart network
    [root@cdh01 abelethan]# service network restart
    
    Restarting network (via systemctl): [ OK ]
  • Check whether the network is available
    [root@cdh01 abelethan]# ping www.baidu.com
    PING www.baidu.com (39.156.66.14) 56(84) bytes of data.
    64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=1 ttl=128 time=36.0 ms
    64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=2 ttl=128 time=36.0 ms​

你可能感兴趣的:(Linux)