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

pigyun25元/月,香港云服务器仅起;韩国云服务器,美国CUVIP

pigyun怎么样?PIGYun成立于2019年,2021是PIGYun为用户提供稳定服务的第三年,期待我们携手共进、互利共赢。PIGYun为您提供:香港CN2线路、韩国CN2线路、美西CUVIP-9929线路优质IaaS服务。月付另有通用循环优惠码:PIGYun,获取8折循环优惠(永久有效)。目前,PIGYun提供的香港cn2云服务器仅29元/月起;韩国cn2云服务器仅22元/月起;美国CUVI...

美国高防云服务器 1核 1G 10M 38元/月 百纵科技

百纵科技:美国云服务器活动重磅来袭,洛杉矶C3机房 带金盾高防,会员后台可自助管理防火墙,添加黑白名单 CC策略开启低中高.CPU全系列E52680v3 DDR4内存 三星固态盘列阵。另有高防清洗!百纵科技官网:https://www.baizon.cn/联系QQ:3005827206美国洛杉矶 CN2 云服务器CPU内存带宽数据盘防御价格活动活动地址1核1G10M10G10G38/月续费同价点击...

cyun29元/月,香港CN2 GIA云服务器低至起;香港多ip站群云服务器4核4G

cyun怎么样?cyun蓝米数据是一家(香港)藍米數據有限公司旗下品牌,蓝米云、蓝米主机等同属于该公司品牌。CYUN全系列云产品采用KVM架构,SSD磁盘阵列,优化线路,低延迟,高稳定。目前,cyun推出的香港云服务器性价比超高,香港cn2 gia云服务器,1核1G1M/系统盘+20G数据盘,低至29元/月起;香港多ip站群云服务器,16个ip/4核4G仅220元/月起,希望买香港站群服务器的站长...

debian关闭防火墙为你推荐
dota启动项steam上的能不能像dota一样设置启动项进国服服务器翻译怎么才能把英文页面直接翻译成中文亚马逊服务器价格亚马逊都有哪些费用,你知道吗站群是什么意思什么叫网站站群minecraft国外服务器我的世界怎么进美国服务器hnd-132西南大学HND是怎么回事啊?阿里云服务器怎么样阿里云服务器怎么样?用来做网站效果好吗?个人域名申请个人怎么申请网站域名paypal取消自动付款如何关闭Bluehost主机的自动续费功能?香港云服务器推荐香港服务器怎么样?哪个比较好啊?
域名主机 买域名 冰山互联 服务器怎么绑定域名 gg广告 新天域互联 工信部icp备案号 免费活动 php空间购买 metalink 华为云服务登录 域名与空间 云营销系统 学生服务器 免费php空间 umax phpinfo 删除域名 alexa搜 国外bt网站 更多