1,IP
ip是网络进程的地址,由32个01组成。
网络位 主机位
1111110.11111110.11111110.11111110 =254.254.254.254
2,子网掩码
用来划分网络区域
子网掩码非0的位对应的ip上的数字表示这个ip的网络位
子网掩码0位对应的数字是ip的主机位
网络位表示网络区域
主机位表示网络区域里某台主机
例如:子网掩码:255.255.255.0
3,网络通信判定
网络位相同主机位不相同的两个IP可以相互通信
例如:192.168.155.70和192.168.155.80可以相互通信
192.168.155.70/24 中的24=255.255.255.0
4,网络设定工具
ping 检测网络是否通畅
ping -c 1 ping 1 次
ping -w 1 等待1秒
ping -c1 -w1 ip ping1次等待1秒
ifconfig 查看IP信息
ifconfig device ip/24 设定IP
ifconfig device down 关闭
ifconfig device up 开启
ip addr 检测或这顶网络接口
ip addr show 检测
ip addr add ip/24 dev device 设定
ip addr del dev ens160 ip/24 删除
5.图形方式设定ip
使用这个 nm-connection-editor(图形)必须保证 systemctl status NetworkManageret必须开启
设定完成后
nmcli connection down westos
nmcli connection up westos
无图形模式设定
Ctrl alt f2 或 Nmtui 进入无图形模式
6.命令方式设定网络
nmcli device connect ens160 启用ens160网卡
nmcli device show ens160 查看网卡信息
nmcli device connect ens160 启用ens160网卡
ifconfig 查看
nmcli device disconnect ens160 关闭ens160网卡
nmcli device show ens160 查看网卡信息
nmcli device status ens160 查看网卡服务接口信息
nmcli connection show 查看连接
nmcli connection delete ens160 删除连接
nmcli connection add con-name westos ifname ens160 ipv4.method manual ipv4.addresses 192.168.155.90/24 type ethernet 添加连接
nmcli connection up westos 启动
ifconfig ens160 查看ens160