使用Iptables限制内网访问某些网站
说明:RHEL5 Server()内核启用IP路由转发功能,,PC-A(),在RHEL5 Server上通过Iptables限制内网用户访问某些网站。
Iptabels脚本如下:
[******@RHEL5 iptables]# cat
#!/bin/bash
###################################
iptables -t filter -F
iptables -I FORWARD -d -j DROP
iptables -I FORWARD -d -j DROP
iptables -P FORWARD ACCEPT
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_state
###################################
iptables -t nat -F
echo "1" > /proc//ipv4/ip_forward
执行上述Iptables脚本之前通过tcpdump抓包情况如下:
[******@RHEL5 iptables]# iptables -L
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
[******@RHEL5 iptables]# tcpdump host and
tcpdump: WARNING: peth0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on peth0, link-type EN10MB (), capture size 96 bytes
11:39: IP > : R 1891908261:18919082
使用Iptables限制内网访问 来自淘豆网m.daumloan.com转载请标明出处.