幫助中心
這里有最新的使用文檔和教程
Debian10 系統如何配置網卡?
一、網絡配置
由于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:8080
user:pass@192.168.1.1:8080
socks4://192.168.1.1:8080
socks5://192.168.1.1:1080
https_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