关机
shutdown -h now 立刻关机,其中now相当于时间为0的状态
shutdown -h 20:25 系统在今天的20:25分会关机
shutdown -r now 系统立刻重新启动
shutdown -r +30 'The system will reboot' 再过30分钟系统会自动重启,并显示后面的信息
shutdown -k now 'The system will reboot' 仅发出警告信件的参数。系统并不会关机
启动网卡
ifconfig eth0 up |
设置IP和掩码
ifconfig eth0 192.168.5.40 netmask 255.255.255.0
设置网关
route add default gw 192.168.1.1
网卡自启动
vi /etc/network/interfaces
内容如下
auto eth1 //自动启用eth1
iface eth1 inet static //eth1为静态IP
address 192.168.0.16 //ip地址
netmask 255.255.255.0 //子网掩码
gateway 192.168.0.1 //网关
dns-nameservers 8.8.8.8
设置DNS
/etc/resolv.conf 内增加
#该文件在重启后会被重写
nameserver 202.96.128.86
nameserver 202.96.128.166