debian关闭防火墙如何查看linux关闭防火墙是否关闭

debian关闭防火墙  时间:2021-05-18  阅读:()

如何在debian下关闭防火墙

ebian下iptables输入命令后即时生效,但重启之后配置就会消失,可用iptables-save快速保存配置,因为Debian上iptables是不会保存规则的,然后在开机自动的时候让iptables自动加载刚刚导出的配置文件,方法如下: 若要停止iptables,iptables -F清空所有配置效果等同于停止。

whereis iptables 查找iptables 所在的路径。

1、将iptables配置保存到/etc/iptables,这个文件名可以自己定义,与下面的配置一致即可 iptables-save > /etc/iptables 2、创建自启动配置文件,并授于可执行权限 iptables-save > /etc/iptables 3、编辑该自启动配置文件,内容为启动网络时恢复iptables配置 vi /work/if-pre-up.d/iptables 内容为: #!/bin/sh /sbin/iptables-restore < /etc/iptables 保存并退出。

这样重启之后iptables就自动加载规则了。

##注意:在下次修改iptables规则之后要重新导出配置文件。

#清空配置 iptables -F iptables -X iptables -Z #配置,禁止进,允许出,允许回环网卡 iptables -P INPUT DROP iptables -A OUTPUT -j ACCEPT iptables -A INPUT -i lo -j ACCEPT #允许ping iptables -A INPUT -p icmp -j ACCEPT #允许ssh iptables -A INPUT -p tcp --dport 22 -j ACCEPT #允许ftp iptables -A INPUT -p tcp --dport 21 -j ACCEPT iptables -A INPUT -p tcp --dport 20 -j ACCEPT #允许ftp被动接口范围,在ftp配置文件里可以设置 iptables -A INPUT -p tcp --dport 20000:30000 -j ACCEPT #学习felix,把smtp设成本地 iptables -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT -s 127.0.0.1 iptables -A INPUT -p tcp -m tcp --dport 25 -j REJECT #允许DNS iptables -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT iptables -A INPUT -p udp -m udp --dport 53 -j ACCEPT #允许http和https iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p tcp --dport 443 -j ACCEPT # 允许已建立的或相关连的通行 iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #禁止其他未允许的规则访问 iptables -A INPUT -j REJECT #(注意:如果22端口未加入允许规则,SSH链接会直接断开。

) iptables -A FORWARD -j REJECT #保存配置 iptables-save > /etc/iptables 由于Debian安装iptables后默认不是服务e79fa5e98193e59b9ee7ad9431333361326231提示service iptables提示unrecognized service,需要添加脚本到/etc/init.d/,脚本如下 建议将其保存为/etc/init.d/iptables,然后chmod +x /etc/init.d/iptables 添加运行权限。

#!/bin/sh -e ### BEGIN INIT INFO # Provides: iptables # Required-Start: # : # Default-Start: 2 3 4 5 # : 0 1 6 # Short-Description: start and iptables firewall # Description: Start, and save iptables firewall ### END INIT INFO PATH=”/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin” IPTABLES=/sbin/iptables IPTABLES_SAVE=/sbin/iptables-save IPTABLES_RESTORE=/sbin/iptables-restore IPTABLES_CONFIG=/etc/iptables.conf [ -x $IPTABLES ] || exit 0 . /lib/lsb/init-functions case "$1" in start) log_action_begin_msg "Starting firewall" type usplash_write >/dev/null 2>/dev/null && usplash_write "TIMEOUT 120" || true if $IPTABLES_RESTORE < $IPTABLES_CONFIG ; then log_action_end_msg $ else log_action_end_msg $ fi type usplash_write >/dev/null 2>/dev/null && usplash_write "TIMEOUT 15" || true ;; ) log_action_begin_msg "Saving current firewall configuration" if $IPTABLES_SAVE > $IPTABLES_CONFIG ; then log_action_end_msg $ else log_action_end_msg $ fi log_action_begin_msg "Flushing ALL firewall rules from chains!" if $IPTABLES -F ; then log_action_end_msg $ else log_action_end_msg $ fi log_action_begin_msg "Deleting ALL firewall chains [Warning: ACCEPTING ALL PORT SERVICES!]" if $IPTABLES -X ; then $IPTABLES -P INPUT ACCEPT $IPTABLES -P FORWARD ACCEPT $IPTABLES -P OUTPUT ACCEPT log_action_end_msg $ else log_action_end_msg $ fi ;; save) log_action_begin_msg "Saving current firewall configuration" if $IPTABLES_SAVE > $IPTABLES_CONFIG ; then log_action_end_msg $ else log_action_end_msg $ fi ;; force-reload|restart) log_action_begin_msg "Reloading firewall configuration [Warning: POTENTIAL NETWORK INSECURITY DURING RELOAD]" $IPTABLES -F $IPTABLES -X if $IPTABLES_RESTORE < $IPTABLES_CONFIG ; then log_action_end_msg $ else log_action_end_msg $ fi ;; *) echo "Usage: /etc/init.d/iptables {start||save|restart|force-reload}" exit 1 ;; esac exit 0

LIUNX4.7怎么关闭防火墙 急急急急!!!!!!!!

1) 永久性生效,重启后不会复原

开启: chkconfig iptables on

关闭: chkconfig iptables off

2) 即时生效,重启后复原

开启: service iptables start

关闭: service iptables

需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了防火墙时,做如下设置,开启相关端口,

修改/etc/sysconfig/iptables 文件,添加以下内容: -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

linux 关闭防火墙命令是什么

1) 永久性生效,重启后不会复原 开启:5261 chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后复原 开启: service iptables start 关闭: service iptables 需要说明的4102是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作1653。

在开启了防火墙时,做如下设置,开启相关端口, 修改/etc/sysconfig/iptables 文件,添加以下内容专: -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 更多属Linux操作知识,可以百度《Linux就该这么学》。

Red Hat linux 6.1如何关闭防火墙

1)立即关闭,并非永久关闭 service iptables 2)永久关闭 iptables -F 关闭防火墙功能 chkconfig iptables off 禁止防火墙启动 另外,运行 setup 在界面,选择Firewall configuration,进入下一界面,选择 Security Level为Disabled,保存。

linux怎么永久关闭防火墙?

1) 重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后失效 开启: service iptables start 关闭: service iptables 需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了防火墙时,做如下设置,开启相关端口, 修改/etc/sysconfig/iptables 文件,添加以下内容: -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

如何查看linux关闭防火墙是否关闭

查看防火墙状态: /etc/init.d/iptables status 暂时关闭防火墙: /etc/init.d/iptables 禁止防火墙在系统启动时启动 /sbin/chkconfig --level 2345 iptables off 重启iptables: /etc/init.d/iptables restart

Friendhosting四五折促销,VPS半年付7.5欧元起

Friendhosting发布了针对“系统管理日”(每年7月的最后一个星期五)的优惠活动,针对VPS主机提供55%的优惠(相当于四五折),支持1-6个月付款使用,首付折扣非永久,优惠后最低套餐首半年7.18欧元起。这是一家保加利亚主机商,成立于2009年4月,商家提供VDS和独立服务器租用等,数据中心目前可选美国洛杉矶、保加利亚、乌克兰、荷兰、拉脱维亚、捷克和波兰等8个地区机房。下面以最低套餐为例...

CloudCone:$17.99/年KVM-1GB/50GB/1TB/洛杉矶MC机房

CloudCone在月初发了个邮件,表示上新了一个系列VPS主机,采用SSD缓存磁盘,支持下单购买额外的CPU、内存和硬盘资源,最低年付17.99美元起。CloudCone成立于2017年,提供VPS和独立服务器租用,深耕洛杉矶MC机房,最初提供按小时计费随时退回,给自己弄回一大堆中国不能访问的IP,现在已经取消了随时删除了,不过他的VPS主机价格不贵,支持购买额外IP,还支持购买高防IP。下面列...

简单测评melbicom俄罗斯莫斯科数据中心的VPS,三网CN2回国,电信双程cn2

melbicom从2015年就开始运作了,在国内也是有一定的粉丝群,站长最早是从2017年开始介绍melbicom。上一次测评melbicom是在2018年,由于期间有不少人持续关注这个品牌,而且站长貌似也听说过路由什么的有变动的迹象。为此,今天重新对莫斯科数据中心的VPS进行一次简单测评,数据仅供参考。官方网站: https://melbicom.net比特币、信用卡、PayPal、支付宝、银联...

debian关闭防火墙为你推荐
免费网站主机求网站免费域名麻烦大家了谢谢。。。另外i追加100分域名购买便宜哪买域名比较便宜,我是玩家买不起贵的华为云服务找回手机华为手机被刷机后还能用华为云服务定位找回吗?有没有免费的服务器有没有免费的电影网站啊 ! 知道请告诉下华为云服务登录电脑版华为账户必须要华为手机登入吗?好看的表格样式创意怎样使用excel制作漂亮的表格ddos防御怎样防御DDOS攻击?域名分类域名如何分类?域名分类域名的基本类型有哪些?菲律宾高防服务器菲律宾高防服务器锐一网络这家公司怎么样?
中文域名 未注册域名查询 希网动态域名 132邮箱 google电话 高防dns 轻博 ev证书 个人免费空间 cpanel空间 大容量存储器 百兆独享 服务器维护方案 admit的用法 100m空间 hkg 免费美国空间 网站在线扫描 闪讯官网 英国伦敦 更多