第十五课课堂笔记

/etc/selinux/config 是selinux的源文件

selinux的三个值

永久关闭selinux,将配置文件的值改为disabled,然后重启生效。

临时关闭selinux:    setenforce 0

查看selinux状态,getenforce

关闭防火墙

systemctl disable firewalld 开机不启动

systemctl stop firewalld.service 关闭服务

yum install -y iptables-services

设置开机启动iptables

systemctl enable iptables $$ systemctl start iptables 

5表

5链

service iptables save才会保存,否则重启以后就会失效。

ICMP它是
TCP/IP协议
族的一个子协议,属于网络层协议,主要用于在主机与路由器之间传递控制信息,包括报告错误、交换受限控制和状态信息等。当遇到IP数据无法访问目标、IP路由器无法按当前的传输速率转发数据包等情况时,会自动发送ICMP消息。ICMP报文在IP帧结构的首部协议类型字段(Protocol 8bit)的值=1。

-F 清除规则

-I插入到第一行

-A插入到最后

之所以B机器ping不通,是因为在A机器上,两个网卡之间缺乏连接。

下面做一下连接

iptables -t nat -A POSTROUTING -s 192.168.100.1/24 -o ens33 -j MASQUERADE

猜你喜欢

转载自blog.csdn.net/m0_37680417/article/details/82055068