more /etc/network/interfaces  ##网卡的相关配置

  1. auto lo
  2. iface lo inet loopback
  3.  
  4. auto eth0
  5. iface eth0 inet static
  6. address 192.168.1.22
  7. netmask 255.255.255.0
  8. gateway 192.168.1.2
  9. dns-nameservers 192.168.1.2
more /etc/hostname   ##主机用户名的配置
  1. ur
more /etc/resolv.conf   ##DNS的配置
  1. nameserver 192.168.1.2
sudo /etc/init.d/networking restart