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