查看: 60|回复: 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:[email protected]

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

在本版发帖返回顶部