码迷,mamicode.com
首页 > 系统相关 > 详细

学习linux第九课!

时间:2020-05-23 11:28:36      阅读:59      评论:0      收藏:0      [点我收藏+]

标签:tcp   -o   配置   查看   table   editor   port   img   drop   

第八章 iptables和firewalld防火墙

iptables rhel5、rhel6、rhel7.0、7.1

firewalld -------
firewall-cmd--------命令行
firewall-config------图形化

tcp_wrappers


网卡配置:
编辑/etc/sysconfig/network-script/ifcfg-eno16777736(选择相关网卡)
nmtui网络配置工具(rhel5/6 是setup)

nm-connection-editor



防火墙动作:
允许:ACCEPT
拒绝:REJECT
丢弃:DROP
日志:LOG




8.1iptables
技术图片

iptables -L 查看防火墙规则
iptables -F 清空防火墙规则
iptables -D INPUT 1 删除input第一条
iptables -P INPUT DROP 丢弃入方向所有流量
iptables -I INPUT -j REJECT -p tcp --dport 22
iptables -I INPUT -j ACCEPT -p tcp --dport 22 -s 192.168.1.2




8.2 firewalld
firewalld-cmd
技术图片
两个模式:
--runtime:当前生效,重启后失效
--permanent:当前不生效,而重启后生效



firewall-cmd --reload:重启防火墙服务,使配置生效
firewall-cmd --panic-on:紧急模式,断开全部网络连接

学习linux第九课!

标签:tcp   -o   配置   查看   table   editor   port   img   drop   

原文地址:https://blog.51cto.com/13660223/2497780

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!