码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu静态ip配置

时间:2018-08-13 12:22:32      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:不能   address   重启   4.0   系统   names   平台   网络   域名解析   

目录

平台: ubuntu 14.04 x64

找到并打开配置文件

sudo vi  /etc/network/interfaces

编辑该文件

添加以下代码完成静态ip配置

    auto ens33
    // 默认是dhcp, 将其修改为static
    iface ens33 inet static
    // 指定IP固定的IP地址
    address 192.168.1.100
    // 指定子网掩码
    netmask 255.255.255.0
    // 指定网关
    gateway 192.168.1.1
    // 指定dns域名解析服务器
    dns-nameserver 114.114.114.114

重启网络

如果以下代码不能重启网络,请尝试重启操作系统

sudo service networking restart
或者
sudo /etc/init.d/networking restart

ubuntu静态ip配置

标签:不能   address   重启   4.0   系统   names   平台   网络   域名解析   

原文地址:https://www.cnblogs.com/sean0/p/9466800.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!