該配置環(huán)境為ubuntu16.04.2
(一) 網(wǎng)絡(luò)配置
安裝完成系統(tǒng)后網(wǎng)絡(luò)配置如下:

第一步:ifconfig -a 查看有幾個(gè)網(wǎng)卡
如下截圖表示有四個(gè)網(wǎng)卡

第二步:找出接線網(wǎng)卡
執(zhí)行命令:ifconfig +網(wǎng)卡 up
例:up 第一個(gè)網(wǎng)卡enp4s0f0
ifconfig enp4s0f0 up
然后執(zhí)行命令: ethtool enp4s0f0? 查看Link狀態(tài),如下截圖:

如果是yes表示該網(wǎng)卡已經(jīng)接線 ,嘗試手動配置ip(配置方法請見下一步驟)。如果是no,繼續(xù)ifconfig up其他網(wǎng)卡,直到找到y(tǒng)es的為止。如果全部是no,請檢查網(wǎng)線是否接好
第三步:配置網(wǎng)卡ip(只有臨時(shí)作用,再次重啟服務(wù)器配置會失效)
命令:ifconfig enp11s0f1 10.57.23.13/25
說明:配置網(wǎng)卡 enp11s0f1? IP為10.57.23.13 掩碼是25位。即255.255.255.128
配置好截圖如下:

第四步:檢測連通性
嘗試ping 網(wǎng)關(guān),如果網(wǎng)關(guān)不通,表示直連不通,請檢查網(wǎng)線和配置。網(wǎng)關(guān)通,接著配置默認(rèn)路由,見第五步

第五步:配置路由(臨時(shí),重啟后失效)
route add default gw 10.57.23.1 (默認(rèn)配置這一條后,內(nèi)網(wǎng)可以正常訪問),如果不能,添加如下明細(xì):
route add -net 10.0.0.0/8 gw 10.57.23.1
route add -net 192.168.0.0/16 gw 10.57.23.1
route add -net 172.16.0.0/12 gw 10.57.23.1
route add -net 100.64.0.0/10 gw 10.57.23.1
第六步:寫入配置文件(永久)
注:一定要寫入配置文件
ubuntu為何不直接在最開始寫入配置文件里。因?yàn)閡buntu直接寫入配置文件,不重啟服務(wù)器貌似不生效(個(gè)人經(jīng)驗(yàn))
vim /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
auto enp11s0f1? ? ?
iface enp11s0f1 inet static
address 10.57.23.13
netmask 255.255.255.128
gateway 10.57.23.1
####添加路由,這樣網(wǎng)卡服務(wù)重啟之后這些路由就會加載
up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.57.23.1
up route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.57.23.1
up route add -net 172.16.0.0 netmask 255.240.0.0 gw 10.57.23.1
up route add -net 100.64.0.0 netmask 255.192.0.0 gw 10.57.23.1

重啟網(wǎng)卡服務(wù)之后,配置的路由會自動加載,如下:

(二) 修改ssh 配置文件
ubuntu系統(tǒng)安裝,默認(rèn)是禁止root直接登錄的
vim /etc/ssh/sshd_config
修改:PermitRootLogin yes
然后重啟ssh服務(wù) /etc/init.d/ssh restart