查看: 16|回覆: 0

[Debian] debian最小化安装后网络问题

[複製鏈接]

1

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2008-2-26
發表於 2019-9-28 14:07:00 | 顯示全部樓層 |閲讀模式
vi /etc/network/interfaces


vi /etc/resolv.conf

apt-get -y install net-tools

content

cat /etc/resolv.conf

nameserver 180.76.76.76
nameserver 8.8.8.8

cat /etc/network/interfaces

# 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


/etc/init.d/networking restart
systemctl restart networking.service

更换阿里源

mv /etc/apt/sources.list{,bak}
cat > /etc/apt/sources.list << 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


来源:https://www.cnblogs.com/wobushimashen/p/11602944.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部