linux固定静态ip设置
1 修改网卡设置
bear@njava:~$ sudo vi /etc/network/interfaces auto lo iface lo inet loopback auto etho iface etho inet static address 192.168.0.101 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1 bear@njava:~$ sudo /etc/init.d/networking start
2 增加DNS
bear@njava:~$ sudo vi /etc/resolv.conf nameserver 8.8.8.8 nameserver 192.168.0.1