#######unit.11#######


管理网络


1.ip基础知识

1.ipv4   2进制32位---10进制


172.25.18.10/255.255.255.0

172.25.18.10:ip地址

255.255.255.0:子网掩码

子网掩码255位对应的ip位为网络位

子网掩码0对应的ip位为主机位


2.配置ip

###图形化

1.图形化

nm-connection-editor

2。文本化图形

nmtui


###命令

ifconfig 网卡 ip netmask    ###临时设定


###文件

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              

NAME=eth0  

IPADDR=172.25.18.88        ###IP

NETNASK=255.255.255.0 | PREFIX=24   ###子网掩码