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

Unix/Linux
FreeBSD 远程存取
freeBSD初学者入门指南
FREEBSD手工配置网络
查看 FreeBSD 登陆记录
登入和注销 FreeBSD 系统
删除 FreeBSD 账号
新增 FreeBSD 账号
菜鸟学装FreeBSD5.1图解
freebsd 单一网卡配置多个IP
FreeBSD 6.2-RELEASE下载
FreeBSD 上彻底禁用 sendmail
FreeBSD 7.0 高速下载
FreeBSD架設 FTP
FreeBSD6.2上搭建apache2.2+mysql5.11+php5+phpmyadmin
UNIX各类操作系统密码破解方法介绍
7.0 Release i386 DVD iso 下载
RedHat 6.2 中文字体TrueType的使用
FREEBSD6.2 详细安装图解
配置lagg, 实现cisco 2950 与Freebsd 7.0链路聚合笔记
FreeBSD查看即时网络流量

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


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