当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > Linux操作系统下IPTables配置方法详解

Unix/Linux
linux紧急救援模式
论学习
让你firefox快起来
我的fedora core 3汉化之旅
几个在线英汉字典网站
JPEG 简易文档 V2.11(转贴)
加罗华简介
怎么消除linux下的屏幕偏移现象和调整屏幕刷新率?
我哥哥去了西安做生意去了
2005第二号公告
squid的配置文件
尖峰时刻
grub硬盘安装hiweed-debian-desktop_0.55
hiweed0.55下xmms菜单乱码的解决
proftp详细配置一览
使用者管理--sudo
Windows 2003和Redhat Linux7.3安装问题
Find命令使用详解
今天开始找工作了
如何对系统做镜像以提高系统高可用性和性能

Unix/Linux 中的 Linux操作系统下IPTables配置方法详解


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 157 ::
收藏到网摘: n/a

如果你的IPTABLES基础知识还不了解,建议先去看看。

们来配置一个filter表的防火墙

1、查看本机关于IPTABLES的设置情况

[root@tp ~]# iptables -L -n

Chain INPUT (policy ACCEPT)

target prot opt source destination

Chain FORWARD (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

Chain RH-Firewall-1-INPUT (0 references)

target prot opt source destination

ACCEPT all -- 0.0.0.0/0 0.0.0.0/0

ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255

ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0

ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0

ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353

ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631

ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:25

REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

可以看出我在安装linux时,选择了有防火墙,并且开放了22,80,25端口.

如果你在安装linux时没有选择启动防火墙,是这样的

[root@tp ~]# iptables -L -n

Chain INPUT (policy ACCEPT)

target prot opt source destination

Chain FORWARD (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

什么规则都没有.

[1] [2] [3] [4] 下一页