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

Unix/Linux
小型机cpu类型
bind9的安装
如何查看服务器上有多少个CPU
wu-ftp 设置匿名服务器(转载)
Solaris硬盘分区学习笔记(转载)
如何在solaris中添加删除磁盘和分区 (转载)
共享光驱怎么做?
改solaris 8的ip地址的问题
加路径的问题 ;(
超级终端如何发送STOP+A?
如何对某个端口限制IP访问 比如 针对1521端口 只允许某个IP访问
如何让root用户远程telnet?
/usr/lib/ld.so.1损坏或丢失
[分享]Sun X3151A 光纤网卡故障排除实例
[分享]Solaris 2.6+Ultra5内置扬声器故障诊断实例
在VMWARE上装Sun Cluster 3.1 Update 3(ZT )
Windows客户端使用UNIX打印服务器上共享打印机的方法
如何改网卡IP地址
[color=darkblue]CacheFS笔记[/color]
在SUN工作站上安装RTL8139网卡

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 110 ::
收藏到网摘: 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] 下一页