Linux 基本命令-防火墙
2016-05-31 15:07
204 查看
Linux 关闭防火墙
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于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
redhat 采用上面的可以,但是ubuntu 却不行
1、关闭ubuntu的防火墙
ufw disable
开启防火墙
ufw enable
ubuntu 的其他关闭命令
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
相关知识:
1. 在fedora系统下:
/etc/init.d/iptables stop
2.ubuntu系统下:
由于UBUNTU没有相关的直接命令
请用如下命令
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
暂时开放所有端口
Ubuntu上没有关闭iptables的命令
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于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
redhat 采用上面的可以,但是ubuntu 却不行
1、关闭ubuntu的防火墙
ufw disable
开启防火墙
ufw enable
ubuntu 的其他关闭命令
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
相关知识:
1. 在fedora系统下:
/etc/init.d/iptables stop
2.ubuntu系统下:
由于UBUNTU没有相关的直接命令
请用如下命令
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
暂时开放所有端口
Ubuntu上没有关闭iptables的命令
相关文章推荐
- 开源新闻速递:LinuxCon Japan 2016 将在东京召开
- 逻辑卷管理
- linux 用户授权
- Linux系统实现mysql主从复制
- JDK在LINUX系统平台下的部署案例与总结
- centos6.7 配置外网端口映射
- linux动态库加载的秘密
- Linux/Unix 桌面趣事:文字模式下的 ASCII 艺术与注释绘画
- Linux中使用mysqldump对MySQL数据库进行定时备份
- Linux下安装配置FastDFS
- 使用gdb调试内核错误信息
- Unix/Linux系统下的高级C编程的主要内容1、20160531
- 本地通知
- linux下SVN提交代码时报 $SVN…
- centos 6.3 安装git:&nb…
- 《Linux及安全》实践3.3
- linux课堂笔记
- 《Linux及安全》实践3.2
- 《Linux及安全》实践3.1
- Linux下的PCB:task_struct