您的位置:首页 > 其它

ubuntu修改ip获取方式(静态,动态)

2015-06-01 10:21 501 查看
1、直接修改系统配置文件
  ubuntu的网络配置文件是:/etc/network/interfaces

  a、动态ip方式

  auto eth0
  iface eth0 inet dhcp
  用下面的命令使网络设置生效:
  sudo /etc/init.d/networking restart

  b、静态ip方式

  auto eth0
  iface eth0 inet static
  address 192.168.1.22
  gateway 192.168.1.1
  netmask 255.255.255.0
  #network 192.168.1.0
  #broadcast 192.168.1.255

  将上面的ip地址等信息换成你自己就可以了.用下面的命令使网络设置生效:
  sudo /etc/init.d/networking restart  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: