`
java_my_life
  • 浏览: 258836 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ubuntu设置ip

 
阅读更多

ubuntu的网络配置信息放在 /etc/network/interfaces 中,

sudo vi /etc/network/interfaces

 如果配置动态获取ip,则在上述文件中加入以下内容:

auto eth0
iface eth0 inet dhcp

 如果配置静态ip,则添加如下内容:

auto eth0
     iface eth0 inet static
     address 192.168.33.201
     netmask 255.255.255.0
     gateway 192.168.33.1

 要是配置生效,需要重启网卡:

 

ifconfig eth0 down
     ifconfig eth0 up 

 

若还有没有配置成功,则需重启下网络服务

/etc/init.d/networking restart
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics