1.设置静态IP
root@mfleat-K43SJ:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.100.6
gateway 192.168.100.1
netmask 255.255.255.0
2.网关设置(最后发现网络不通是没有网关,不知道怎么没的。。)
route add default gw 192.168.100.1
route -n / netstat -r
3.设置DNS
root@mfleat-K43SJ:~# cat /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
4.测试
root@mfleat-K43SJ:~# ping mreald.com
PING mreald.com (192.157.226.242) 56(84) bytes of data.
64 bytes from 192.157.226.242: icmp_seq=1 ttl=51 time=209 ms
64 bytes from 192.157.226.242: icmp_seq=2 ttl=51 time=209 ms
^C
— mreald.com ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 209.028/209.285/209.543/0.524 ms
如果是vbox中的虚拟机,想上网并且与主系统互通: 设置桥接网上
自动登陆:vim /etc/lightdm/lightdm.conf (add)autologin-user=vita