Debian 网络设置以及非法关机后无法联网 connect: network is unreachable

网络配置: 临时(重丢失)

ifconfig eth0 192.168.1.xxx netmask 255.255.xxx.0

 

永久(重启有效)

vi /etc/network/interfaces

 

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.xxx
        netmask 255.255.xxx.0
        network 192.168.1.1
        broadcast 192.168.1.255
        gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 202.106.196.115

 

于非法关机导致重启后无法联网

ifconfig eth0 192.168.1.xxx netmask 255.255.xxx.0 

 

route add default gw 192.168.1.1

 

重启后配置丢失,所以必须在重启之前执行:

apt-get update

 

apt-get install ifupdown

 

不能联网是因为非法关机导致ifup脚本丢失

posted on 2014-05-01 22:10  IceWee  阅读(1761)  评论(0编辑  收藏  举报

导航