标签:启动 ifconf 阿里 dns服务 ifconfig pre 不能 names www
1、查看网卡状态root@Ubuntu-Ansible:~# ifconfig -a
root@Ubuntu-Ansible:~# ip addr
root@Ubuntu-Ansible:~# ip route show
root@Ubuntu-Ansible:~# vim /etc/network/interfaces
加入如下内容:
auto eth0
iface eth0 inet static
address 192.168.1.5
gateway 192.168.1.1
netmask 255.255.255.0
root@Ubuntu-Ansible:~# vim /etc/resolvconf/resolv.conf.d/base
DNS修改如下文件,默认是空的,在里面加入DNS服务器,一行一个
nameserver 180.76.76.76 # 百度DNS
nameserver 223.5.5.5 # 阿里DNS
保存后执行:
root@Ubuntu-Ansible:~# /sbin/resolvconf -u
或
root@Ubuntu-Ansible:~# etc/init.d/resolvconf restart
root@Ubuntu-Ansible:~# cat /etc/resolv.conf
root@Ubuntu-Ansible:~# /etc/init.d/networking restart
重启网卡:
root@Ubuntu-Ansible:~# ifconfig eht0 down
root@Ubuntu-Ansible:~# ifconfig eht0 up
重启Ubuntu:
root@Ubuntu-Ansible:~# reboot
root@Ubuntu-Ansible:~# ps -e|grep ssh
root@Ubuntu-Ansible:~# apt-get install openssh-sever
root@Ubuntu-Ansible:~# /etc/init.d/ssh start
root@Ubuntu-Ansible:~# netstat -tlp
root@Ubuntu-Ansible:~# apt-get update
root@Ubuntu-Ansible:~# apt-get upgrade
root@Ubuntu-Ansible:~# apt-get dist-upgrade
root@Ubuntu-Ansible:~# reboot
标签:启动 ifconf 阿里 dns服务 ifconfig pre 不能 names www
原文地址:http://blog.51cto.com/tangyade/2330627