强国中 發表於 2019-9-28 14:07:00

debian最小化安装后网络问题

<pre><code>vi /etc/network/interfaces


vi /etc/resolv.conf

apt-get -y install net-tools

</code></pre>
<p>content</p>
<p>cat /etc/resolv.conf</p>
<pre><code>nameserver 180.76.76.76
nameserver 8.8.8.8
</code></pre>
<p>cat/etc/network/interfaces</p>
<pre><code># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens33
iface ens33 inet static #dhcp
address 192.168.1.130
netmask 255.255.255.0
gateway 192.168.1.1

</code></pre>
<pre><code>
/etc/init.d/networking restart
systemctl restart networking.service

</code></pre>
<p>更换阿里源</p>
<pre><code>mv /etc/apt/sources.list{,bak}
cat &gt; /etc/apt/sources.list &lt;&lt; EOF
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
    deb http://mirrors.aliyun.com/debian-security stretch/updates main
    deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
   deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
   deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
    EOF
    apt update
apt-get -y install net-tools
apt-get -y install openssh-server
      vi /etc/ssh/sshd_config
      service sshd restart
</code></pre><br><br>
来源:https://www.cnblogs.com/wobushimashen/p/11602944.html
頁: [1]
查看完整版本: debian最小化安装后网络问题