博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
配置linux-Fedora系统下iptables防火墙
阅读量:6982 次
发布时间:2019-06-27

本文共 788 字,大约阅读时间需要 2 分钟。

参考地址:https://blog.csdn.net/zhangjingyi111/article/details/78902820

本篇文章为实验课过程记录,较为简略。

 

1.查看系统是否安装iptables

命令:iptables --version

 

2.开启iptables

命令:service iptables start

出现错误:Failed to restart iptables.service: Unit iptables. service failed to load: No such file or directory.

解决方法:

命令:

systemctl stop firewalld 

systemctl mask firewalld 

然后安装iptables-services,需要root身份,命令:su root

安装:

dnf install iptables-services

systemctl enable iptables

service iptables save  

 

3.查看规则

命令:iptables -L

 

4.添加规则

命令: iptables -A INPUT -p tcp --dport 22 -j ACCEPT

 

例如,开启SNMP端口

iptables -I INPUT -p UDP --dport 161 -j ACCEPT

 

把规则保存,下次重启防火墙,对应的规则就会生效,保存的规则存放在:/etc/sysconfig/iptables

service iptables save

 

配置一个范围端口:

iptables -I INPUT -p TCP --dport 12345:65535 -j ACCEPT

 

转载于:https://www.cnblogs.com/dyh004/p/9294888.html

你可能感兴趣的文章
IT十八掌掌第二天课程总结
查看>>
职业SNS天际网:透视“屌丝文化” 解析当今职场
查看>>
Leetcode 29. Divide Two Integers
查看>>
Kubernetes 1.5集成heapster
查看>>
清华赵骥主任与CIO石海军研讨互联网信息化
查看>>
tnsname.ora文件解析
查看>>
论文:论项目的计划和监控
查看>>
linux启动引导过程 grub和mbr
查看>>
lnmp环境安装
查看>>
Codeforces Round #438 868A/B/C
查看>>
每天一个linux命令(4):mkdir命令
查看>>
课后作业4之个人总结
查看>>
php常用的系统函数大全
查看>>
Jade To Pug过程中的一个小问题
查看>>
在ubuntu中搜索文件或文件夹的方法
查看>>
ioc——实现原理
查看>>
腾讯hr面
查看>>
iOS开发之SceneKit框架--SCNGeometry.h
查看>>
对事件委托绑定click的事件的解绑
查看>>
localstorage和sessionstorage上手使用记录
查看>>