1、ifconfig命令设置(临时设置)
**ifconfig 网络接口 ip netmask 子网掩码
2、图形网络配置方式
**nm-connection-editor ##图形中的网络设定工具
**nmtui ##文本中的网络设定工具
3、nmcli命令设定ip的方式
**nmcli connection delete 连接名称 ##删除此连接
**nmcli connection add con-name westos ifname eth0 type ethernet autoconnect yes ##添加动态网络
**nmcli connection add con-name westos ifname eth0 type ethernet ip4 ip/24 gw4 ip ###静态网络
4、网络配置文件
/etc/sysconfig/network-scripts/ ###网络配置目录
1)动态网络配置
vim ifcfg-xxx ###网络配置文件格式
DEVICE=eth0 ##指定文件管理的设备名称
BOOTPROTO=dhcp ##dhcp动态获取,none和static都表示静态网络
ONBOOT=yes ##开机自动激活设备
NAME=hello ##指定网络链接的名字为hello
2)静态网络配置
vim ifcfg-xxx ###网络配置文件格式
DEVICE=eth0 ##指定文件管理的设备名称
BOOTPROTO=static|none ##dhcp动态获取,none和static都表示静态网络
ONBOOT=yes ##开机自动激活设备
NAME=hello ##指定链接名字
IPADDR=172.25.254.100 ##设定ip为172.25.254.100
NETMASK=255.255.255.0 ##子网掩码为255.255.255.0
PREFIX=24 ##子网掩码为255.255.255.0