ubuntu下网络配置

  

输入命令1:,

  

# DHCP自动获取ip配置
  汽车lo ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#开机自动激lo接口
  iface lo inet loopback ,,,,,,,,,,,,,,,,,,,,,,#配置lo接口为环回口
  汽车eth0 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#开机自动激活eth0接口
  iface eth0 inet dhcp ,,,,,,,,,,,,,,,,,,,,,,,,#配置eth0接口为DHCP自动获取

  

#静态分配IP地址配置
  汽车lo ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#开机自动激lo接口
  iface lo inet loopback ,,,,,,,,,,,,,,,,,,,,,,#配置lo接口为环回口
  汽车eth0 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#开机自动激活eth0接口
  iface eth0 inet static ,,,,,,,,,,,,,,,,,,,,,,#配置eth0接口为静态设置IP地址
  地址192.168.1.10
  子网掩码255.255.255.0
  网络192.168.1.0
  广播192.168.1.255
  网关192.168.1.1

  

# DNS配置
  sudo vi/etc/resolv.参看
  命名服务器192.168.1.1

  

输入命令2:sudo/etc/init.d/网络restart ,,#重启网络

ubuntu下网络配置