Debian10 安装后网络配置

您所在的位置:网站首页 debian网卡设置dhcp后无法过去ip Debian10 安装后网络配置

Debian10 安装后网络配置

2023-09-01 19:02| 来源: 网络整理| 查看: 265

一、网络配置

由于Debian10的vi是精简版不好用所以先配置一下镜像源安装vim 打开vi /etc/apt/sources.list输入以下内容(i键输入,删除键不好用最好一次性输入对,删除按delete键):

deb http://mirrors.163.com/debian/ buster main non-free contrib # 适用于所有版本 deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free

然后更新镜像源apt-get update 安装vim:apt-get install vim -y

# 打开网卡文件 vim /etc/network/interfaces

填入内容

auto ens33 # 网卡随系统自动启动 iface ens33 inet static # 网卡为静态ip地址 address 192.168.2.86 # 设置ip地址 netmask 255.255.255.0 # 子网掩码 gateway 192.168.2.1 # 网关 dns-nameservers 223.5.5.5 223.6.6.6 # DNS

注意:vim /etc/resolv.conf 的nameservers是否配置正确

重启网络服务

service networking restart # 或者 systemctl restart networking 二、设置镜像源

以Buster为例, 编辑/etc/apt/sources.list文件, 在文件最前面添加以下条目(操作前请做好相应备份)

deb http://mirrors.163.com/debian/ buster main non-free contrib deb http://mirrors.163.com/debian/ buster-updates main non-free contrib deb http://mirrors.163.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.163.com/debian/ buster main non-free contrib deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

也可访问http://mirrors.163.com/.help/debian.html

apt-get update # 更新 三、安装ssh服务 apt-get install openssh-server -y

配置vim /etc/ssh/sshd_config文件,使root可以远程登录

PermitRootLogin yes # 设置为yes PasswordAuthentication yes # 是否允许使用基于密码的认证

重启ssh服务

systemctl restart sshd 四、安装VMtools apt-get install open-vm-tools 五、设置代理 环境变量描述示例http_proxy为http变量设置代理;默认不填开头以http协议传输192.168.1.1:8080user:[email protected]:8080socks4://192.168.1.1:8080socks5://192.168.1.1:1080https_proxy为https变量设置代理同上ftp_proxy为ftp变量设置代理同上all_proxy全部变量设置代理,设置了这个时候上面的不用设置同上no_proxy无需代理的主机或域名;可以使用通配符;多个时使用“,”号分隔;.aiezu.com,10...,192.168..,*.local,localhost,127.0.0.1 export http_proxy=http://IP地址:端口号 export https_proxy=http://user:password@IP地址:端口号 export ftp_proxy=http://IP地址:端口号 export no_proxy="localhost,127.0.0.1" # 永久配置需要配置/etc/profile 六、取消代理 unset http_proxy unset https_proxy unset ftp_proxy unset no_proxy


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3