1、查看網絡接口參數
ifconfig
#查看網絡接口參數
ifconfig eth0 192.168.1.0 netmask 255.255.255.0
#臨時設置eth0網卡的IP爲192.168.1.0,子網掩碼爲255.255.255.0
(永久設置的方法:https://blog.csdn.net/vincen123/article/details/81456702)
ifconfig eth0
#查看eth0網卡的信息
ifconfig eth0 down
#關閉eth0接口
2、設備主機名
hostname
#查看當前主機名
hostnamectl status
#查看主機名稱以及主機信息
vim /etc/hostname
#修改主機名的配置文件信息
3、網絡路由參數
route
#查看當前路由表
route -n
#使用數字地址代替主機名稱
route add default gw 172.25.0.25
#添加默認網關爲172.25.0.25
route add -net 172.25.0.26/16 gw 192.168.0.1
#添加指定網段的網關
route add -net 192.168.0.1 netmask 255.255.255.0 dev eth0
#添加路由記錄,指定通過eth0網卡傳輸到192.168.0.1網段的數據
route del default gw 192.169.1.254
#刪除默認網關
4、DNS解析地址的配置文件
vim /etc/resolv.conf
5、重新啓動網絡服務並使配置生效
systemctl restart network
或者
service network restart