●管理网络
1.ip基础知识
ipv4/ipv6
32位
172.25.0.10/255.255.255.0
2.配置ip
<>
1。图形界面
nm-connection-editor
2.文本化图形
nmtui
ifconfig查看或者临时设定主机ip的工具
ifconfig 网络接口查看这个接口上的 ip
ifconfig 网络接口 ip netmask 子网掩码临时设定ip
ifconfig eth0 172.25.254.100 netmask 255.255.255.0
systemctl restart network重新启动网络基本服务
systemctl restart NetworkManager网络智能管理服务
<>
ifconfig 网卡 ip netmask 临时设定
nmcli :
system ststus NetWork
connection add type ethernet con-name westos ifname eth0 autoconnect yes
nmcli connection add type ethernet con-name westos ifname ip4 ip/24
nmcli connection add delete westos
nmcli connection show
nmcli connection down westos
nmcli connection up westos
nmcli connection modify westos ipv4.addresses newip/24
nmcli connection modify westos ipv4.method
nmcli device connect
nmcli device disconnect
nmcli device show
nmcli device status
<>
dhcp 动态获取
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
NAME=eth0
:wq
systemctl restart network
static|none 静态网络
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static|none
ONBOOT=yes
IPADDR(x)=172.25.0.100
NETNASK=172.25.0.100 | PREFIS0=24 子网掩码
NAME=eth0
:wq
systemctl restart network
如果要设置多个ip 就在x位置