In other languages:English | 中文(简体) | 中文(繁體) | Български | Català | Cymraeg | Galego | Magyar | Italiano | Nederlands | Português | Русский | Tiếng Việt
安装Fedora-14
在此处获得Fedora-14安装的鏡像文件。
在计算机安装Fedora-14-x86_64-DVD.iso的鏡像文件过程中, 当勾选默认配置时能够顺利完成安装; 当选择全部的安装包时系统提示有三个连接文件存在依赖关系无法完成最终的安装(其所需安装磁盘容量至少28.5GB);
配置Fedora-14系统
VM虚拟机CPU饱和后不允许溢出运行;
解决root用户直接登入问题
su -
密码:
输入命令:gedit /etc/pam.d/gdm&
在文本编辑器中注释掉"auth required pam_succeed_if.so user!=root quiet"这一行(在这一行前面加上"#"注释,即改成#auth required pam_succeed_if.so user!=root quiet)
保存后继续输入命令:gedit /etc/pam.d/gdm-password&
同样地注释掉"auth required pam_succeed_if.so user!=root quiet"这一行。
保存后退出
现在就能使用root用户登录了
安装f-prot
(download_http://www.f-prot.com/download/home_user/)
cd /usr/local/src
tar zxvf fp-Linux-x86_64-ws.tar.gz
cd f-prot
./install-f-prot.pl
选用默认的安装目录/usr/local/bin
选用默认的安装手册目录/usr/share/man/man8
all done!
全盘扫描
fpscan -a
扫描结果
files:88552
skipped files:0
files with errors:2
Running time:06:28
配置DNS服务器
rpm -ivh bind-9.7.2-2.P2.fc14.x86_64.rpm
service named start
查看主机名称
#honstname
设置随机启动named服务:chkconfig --level 35 named on
配置主机名:
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=example.com.cn
GATEWAY=192.168.1.5
完成本地域名解析
vi /etc/hosts
192.168.122.192 example.com.cn example # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost localhost4
::1 example.com.cn example localhost6.localdomain6 localhost6
查看etc/host.conf文件
vi /etc/host.conf
multi on
order hosts,bind
配置网卡:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="none"
DEFROUTE="yes"
DNS1="192.168.122.192"
DOMAIN="com.cn"
GATEWAY="192.168.1.5"
HWADDR="00:16:96:16:3A:14"
IPADDR="192.168.122.192"
IPV4_FAILURE_FATAL="yes"
IPV6INIT="no"
NAME="System eth0"
NM_CONTROLLED="yes"
PREFIX="24"
TYPE="Ethernet"
UUID="5fb06bd0-0bb0-7ffd-45f1-d6edd65f3e03"
NETMASK=255.255.255.0
USERCTL=no
DNS2=192.168.1.5
配置本机DNS解析文件(系统>>管理>>网络>>DNS)
vi /etc/resolv.conf
# Generated by NetworkManager
search com.cn
nameserver 192.168.122.192 //配置本机主域名服务器IP
nameserver 192.168.1.5 //配置外网域名服务器IP
配置named主文件
cp /etc/named.conf /home/patriotserver/下载
vi /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { any; }
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53;
query-source-v6 port 53;
allow-query { any; };
allow-query-cache { any;};
recursion yes;
recursive-clients 10000;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* path to ISC DLV key*/
bindkeys-file "/etc/named/dynamic";
};
logging { channel default_debug { file "data/named.run"; severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
配置定义文件vi /etc/named.rfc1912.zones添加如下文件连接:
zone "explame.com.cn" IN {
type master;
file "example.com.cn.zone";
allow-update { none; };
};
zone "192.168.192.in-addr.arpa" IN {
type master;
file "192.168.122.zone";
allow-update { none; };
};
配置正向解析文件(添加邮件域名@example.com.cn其中MX越小域名越优先):
cd /var/named
cp named.localhost example.com.cn.zone
vi example.com.cn.zone
$TTL 1D
example.com.cn. IN SOA example.com.cn. root.example.com.cn. (
42 ; serial
1D ; refresh
1H ; retry
3H ) ; minimum
example.com.cn. IN NS example.com.cn.
IN A 192.168.122.192
IN AAAA 0000:0000:0000:0000:0000:0000:c0a8:7ac0
IN MX 5 example.com.cn.
www IN A 192.168.122.192
www IN AAAA 0000:0000:0000:0000:0000:0000:c0a8:7ac0
配置反向解析文件:/var/named/192.168.192.arpa
cp named.loopback 192.168.122.arpa
vi 192.168.192.arpa
$TTL 1D
192.168.192.in-addr.arpa. IN SOA example.com.cn. root.example.com.cn. (
42 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
192.168.192.in-addr.arpa. IN NS example.com.cn.
IN A 192.168.122.192
IN AAAA 0000:0000:0000:0000:0000:0000:c0a8:7ac0
192 IN PTR www.example.com.cn.
修改文件所属组:
cd /var/named
chgrp named example.com.cn.zone
chgrp named 192.168.192.arpa
设置文件权限:
chmod 644 /etc/named.conf
chmod 644 /etc/named.rfc1912.zones
chmod 644 /var/named/example.com.cn.zone
chmod 644 /var/named/122.168.192.arpa
重新载入DNS域名解析:
service named reload
测试nslookup
安装mysql
rpm -ivh perl-DBD-Mysql-4.017-1.fc14.x86_64.rpm
rpm -ivh mysql-libs-5.1.51-2.fc14.x86_64.rpm
rpm -ivh mysql-5.1.51-2.fc14.x86_64.rpm
rpm -ivh mysql-server-5.1.52-1.fc14.x86_64.rpm
设置MySQL启动
service mysqld start
cd /usr ; /usr/bin/mysqld_safe &
cd /usr/mysql-test ; perl mysql-test-run.pl
please report any problems with the /usr/bin/mysqlbug script!
正在启动mysqld:[确定]
创建用户密码:
/usr/bin/mysqladmin -u root password ******
设置mysql开机自启动
ntsysv选择mysqld确定
创建数据库 mysql -u root -p ******
mysql> create database mediawiki;
增加一个用户mediawiki去管理mediawiki数据库
mysql> grant select,insert,update,delete on mediawiki.* to mediawiki@localhost identified by "password";
配置Apache服务器
配置mediawiki
cd /var/www/html
tar zxvf mediawiki-1.16.0.tar.gz
chmod 711 mediawiki-1.16.0
cd mediawiki-1.16.0
chmod a+w config
开放图片上传功能
chmod 777 images
改变组别和所有者
cd ..
chown -hR 1000:1000 mediawiki-1.16.0
配置apache服务器
service httpd start
设置开机自启动Apache
ntsysv
配置文件说明如下:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.bak
gedit /etc/httpd/conf/httpd.conf
修改前的旧文件语句
TimeOut 60
KeepAlive Off
#ExtendedStatus on
#ServerName www.example.com:80
UseCanonicalName Off
修改后语句
TimeOut 300
KeepAlive On
ExtendedStatus Off
ServerName www.example.com.cn:80
UseCanonicalName On
添加根文档目录的访问权限:
<Directory "/var/www/html/mediawiki-1.16.0">
Options MultiViews Indexes Includes FollowSymLinks
AllowOverride FileInfo AuthConfig Limit
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
添加如下注释:
<VirtualHost 192.168.122.192:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/mediawiki-1.16.0
ServerName www.example.com.cn
DirectoryIndex index.php index.html index.htm index.shtml
Loglevel debug
HostNameLookups off
</VirtualHost>
重启Apache服务
service httpd restart
或
配置mediawiki选项
修改文件/var/www/html/mediawiki/LocalSettings.php
更改网站左上角的logo为图片文件wiki-indexed.png
在LocalSettings.php中间加入
## Set $wgLogo to the URL path to your own logo image.
$wgLogo = "${wgScriptPath}/skins/monobook/wiki-indexed.png";
编辑重定向mediawiki首页
http://www.example.com.cn/index.php/MediaWiki:Mainpage
配置DHCP服务器
配置mail邮件服务器
配置samba文件服务器
安装samba客户端
rpm -ivh samba-common-3.5.5-68.fc14.1.x86_64.rpm
rpm -ivh samba-client-3.5.5-68.fc14.1.x86_64.rpm
查看共享资源
smbclient -L 192.168.1.254
访问共享资源(使用root账户防止访问本地文件夹受限)
smbclient //192.168.1.254/public -u usename
<smb:\>dir
<smb:\>cd video
<smb:\>get RealPlayer11GOLD.rpm
配置Redhat集群应用
配置防火墙
- <1>更新防火墙iptables-1.4.9.1
下载最新的iptables版本(www.netfilter.org)
scp root@192.168.1.5:/root/iptables-1.4.9.1.tar.bz2
mv /root/iptables-1.4.9.1.tar.bz2 /usr/local/src/
cd /usr/local/src/
tar jxvf iptables-1.4.9.1.tar.bz2
cd iptables-1.4.9.1
./configure
make
make install
- <2>将iptables服务停止
[root@linux-test root] # service iptables stop
用/usr/local/sbin/iptables新文件替换/sbin/iptables(这个是老版本的连接位置)
并同时替换ip6tables、ip6tables-restore、ip6tables-save、iptables、iptables-restore和iptables-save
[root@linux-test root] # cp /usr/local/sbin/iptables /sbin/iptables
iptables就升级完成了,使用下列命令查看
[root@linux-test root] # iptables -V
iptables v1.4.9.1
- <3>使用snort.sh脚本在开机时自动开启防火墙设置
# echo "/etc/rc.d/snort.sh">>/etc/rc.d/rc.local
将snort.sh防火墙脚本放在/etc/rc.d目录中
添加snort.sh文件的可执行权限
#chmod u+x /etc/rc.d/snort.sh
#echo "1" >/proc/sys/net/ipv4/ip_forward
或是修改/etc/sysctl.conf把net.ipv4.ip_forward = 0改为= 1
以下为防火墙脚本snort.sh内容:
#!/bin/bash
echo "1" >/proc/sys/net/ipv4/ip_forward
inet_iface="eth0"
inet_ip="*.*.*.*"
lan_iface="eth1"
lan_ip="*.*.*.*"
lan_ip_range="192.168.1.0/24"
dns1="*.*.*.*"
dns2="*.*.*.*"
ntp="*.*.*.*"
ipt="/sbin/iptables"
/sbin/depmod -a
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_conntrack_irc
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ipt_connlimit
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_LOG
$ipt -P INPUT DROP
$ipt -P FORWARD DROP
$ipt -P OUTPUT ACCEPT
$ipt -t nat -P PREROUTING ACCEPT
$ipt -t nat -P POSTROUTING ACCEPT
$ipt -t nat -P OUTPUT ACCEPT
for TABLE in filter nat mangle ; do
$ipt -t $TABLE -F
$ipt -t $TABLE -X
done
$ipt -t filter -A INPUT -s $lan_ip_range -i $inet_iface -j DROP
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -s 192.168.0.0/16 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -s 10.0.0.0/8 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -s 172.16.0.0/16 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -s 127.0.0.0/8 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -p udp -i $lan_iface --dport 67 --sport 68 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 0:19 -j DROP
$ipt -t filter -A INPUT -p udp --dport 0:19 -j DROP
$ipt -t filter -A INPUT -p udp --dport 22 -j DROP
$ipt -t filter -A INPUT -i $inet_iface -p tcp --dport 22 -j DROP
$ipt -t filter -A INPUT -d 127.0.0.1 -p tcp --dport 22 -j DROP
$ipt -t filter -A INPUT -s $lan_ip -p tcp --dport 22 -j DROP
$ipt -t filter -A INPUT -d 192.168.122.1 -p tcp --dport 22 -j DROP
$ipt -t filter -A INPUT -d $inet_ip -p tcp --dport 22 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 23:24 -j DROP
$ipt -t filter -A INPUT -p udp --dport 23:24 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 26:52 -j DROP
$ipt -t filter -A INPUT -p udp --dport 26:52 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 54:66 -j DROP
$ipt -t filter -A INPUT -p udp --dport 54:66 -j DROP
$ipt -t filter -A INPUT -i $inet_iface -p tcp --dport 67:68 -j DROP
$ipt -t filter -A INPUT -i $inet_iface -p udp --dport 67:68 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 69:79 -j DROP
$ipt -t filter -A INPUT -p udp --dport 69:79 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 81:109 -j DROP
$ipt -t filter -A INPUT -p udp --dport 81:109 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 112 -j DROP
$ipt -t filter -A INPUT -p udp --dport 111:112 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 123 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 114:138 -j DROP
$ipt -t filter -A INPUT -p udp --dport 114:122 -j DROP
$ipt -t filter -A INPUT -p udp --dport 124:138 -j DROP
$ipt -t filter -A INPUT -i $inet_iface -p tcp --dport 139 -j DROP
$ipt -t filter -A INPUT -i $inet_iface -p udp --dport 139 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 140:142 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 144:442 -j DROP
$ipt -t filter -A INPUT -p udp --dport 140:442 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 444:1722 -j DROP
$ipt -t filter -A INPUT -p udp --dport 1723 -j DROP
$ipt -t filter -A INPUT -p udp --dport 444:1862 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 1724:1862 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31790 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31790 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31789 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31789 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31340 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31340 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31339 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31339 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31338 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31338 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31337 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31337 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 31335 -j DROP
$ipt -t filter -A INPUT -p udp --dport 31335 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 30100 -j DROP
$ipt -t filter -A INPUT -p udp --dport 30100 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 27665 -j DROP
$ipt -t filter -A INPUT -p udp --dport 27665 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 27444 -j DROP
$ipt -t filter -A INPUT -p udp --dport 27444 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 27374 -j DROP
$ipt -t filter -A INPUT -p udp --dport 27374 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 23445 -j DROP
$ipt -t filter -A INPUT -p udp --dport 23445 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 23444 -j DROP
$ipt -t filter -A INPUT -p udp --dport 23444 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 19191 -j DROP
$ipt -t filter -A INPUT -p udp --dport 19191 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 14704 -j DROP
$ipt -t filter -A INPUT -p udp --dport 14704 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 10000 -j DROP
$ipt -t filter -A INPUT -p udp --dport 10000 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 9704 -j DROP
$ipt -t filter -A INPUT -p udp --dport 9704 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 9393 -j DROP
$ipt -t filter -A INPUT -p udp --dport 9393 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 8102 -j DROP
$ipt -t filter -A INPUT -p udp --dport 8102 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 8011 -j DROP
$ipt -t filter -A INPUT -p udp --dport 8011 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 7626 -j DROP
$ipt -t filter -A INPUT -p udp --dport 7626 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 7306 -j DROP
$ipt -t filter -A INPUT -p udp --dport 7306 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 6667 -j DROP
$ipt -t filter -A INPUT -p udp --dport 6667 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 6346 -j DROP
$ipt -t filter -A INPUT -p udp --dport 6346 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 6267 -j DROP
$ipt -t filter -A INPUT -p udp --dport 6267 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 6129 -j DROP
$ipt -t filter -A INPUT -p udp --dport 6129 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 6000 -j DROP
$ipt -t filter -A INPUT -p udp --dport 6000 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5900 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5900 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5800 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5800 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5554 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5554 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5400 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5400 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5168 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5168 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5100 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5100 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 5000 -j DROP
$ipt -t filter -A INPUT -p udp --dport 5000 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 4500 -j DROP
$ipt -t filter -A INPUT -p udp --dport 4500 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 4444 -j DROP
$ipt -t filter -A INPUT -p udp --dport 4444 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 3389 -j DROP
$ipt -t filter -A INPUT -p udp --dport 3389 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 3306 -j DROP
$ipt -t filter -A INPUT -p udp --dport 3306 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 3150 -j DROP
$ipt -t filter -A INPUT -p udp --dport 3150 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 3127 -j DROP
$ipt -t filter -A INPUT -p udp --dport 3127 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 3000 -j DROP
$ipt -t filter -A INPUT -p udp --dport 3000 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2989 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2989 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2869 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2869 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2500 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2500 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2475 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2475 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2140 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2140 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2115 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2115 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2023 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2023 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2012 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2012 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2001 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2001 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 2000 -j DROP
$ipt -t filter -A INPUT -p udp --dport 2000 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 1981 -j DROP
$ipt -t filter -A INPUT -p udp --dport 1981 -j DROP
$ipt -t filter -A INPUT -p tcp --dport 1900 -j DROP
$ipt -t filter -A INPUT -p udp --dport 1900 -j DROP
$ipt -t filter -A INPUT -p icmp -m icmp --icmp-type echo-request -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A INPUT -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
$ipt -t filter -A INPUT -p icmp --icmp-type any -m limit --limit 1/sec --limit-burst 10 -j ACCEPT
$ipt -t filter -A INPUT -f -m limit --limit 150/sec --limit-burst 150 -j ACCEPT
$ipt -t filter -A INPUT ! -i lo -m state --state NEW,INVALID -j LOG --log-prefix "iniptables:"
$ipt -t filter -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
$ipt -t filter -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
$ipt -t filter -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
$ipt -t filter -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$ipt -t filter -A INPUT -i $inet_iface -m state --state ESTABLISHED,RELATED -j ACCEPT
$ipt -t filter -A INPUT -i $lan_iface -m state --state ESTABLISHED,RELATED -j ACCEPT
$ipt -t filter -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
$ipt -t filter -A INPUT -i lo -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -m state --state NEW -m udp -p udp --dport domain -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -m state --state NEW -m tcp -p tcp --dport domain -j ACCEPT
$ipt -t filter -A INPUT -s $dns1 -i $inet_iface -m state --state NEW -m udp -p udp --sport domain -j ACCEPT
$ipt -t filter -A INPUT -s $dns1 -i $inet_iface -m state --state NEW -m tcp -p tcp --sport domain -j ACCEPT
$ipt -t filter -A INPUT -s $dns2 -i $inet_iface -m state --state NEW -m udp -p udp --sport domain -j ACCEPT
$ipt -t filter -A INPUT -s $dns2 -i $inet_iface -m state --state NEW -m tcp -p tcp --sport domain -j ACCEPT
$ipt -t filter -A INPUT -p udp --dport domain ! -s $dns1 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -p tcp --dport domain ! -s $dns1 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -p udp --dport domain ! -s $dns2 -i $inet_iface -j DROP
$ipt -t filter -A INPUT -p tcp --dport domain ! -s $dns2 -i $inet_iface -j DROP
$ipt -t filter -N LOGJOIN
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p tcp -m tcp --dport 22 -j LOGJOIN
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p tcp -m tcp --dport 22 -j LOGJOIN
$ipt -t filter -A LOGJOIN -j LOG --log-prefix "iptenter:"
$ipt -t filter -A LOGJOIN -j ACCEPT
$ipt -t filter -A INPUT -i $lan_iface -p udp --dport 67 -j ACCEPT
$ipt -t filter -A INPUT -i $lan_iface -p tcp --dport 67 -j ACCEPT
$ipt -t filter -A INPUT -i $inet_iface -p tcp -m multiport --dports 6160,5989,1863,1723,995,993,443,143,113,111,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A INPUT -i $inet_iface -p udp -m multiport --dports 1863,443,113,110,80,21,20 -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p ah -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p esp -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p tcp -m multiport --dports 6160,2049,1863,1723,995,993,445,443,139,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p tcp -m multiport --dports 21064,11111,5989,143,111 -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p udp -m multiport --dports 5405,5404,1863,1194,445,443,138,137,123,113,110,80,69,21,20 -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p udp -m multiport --dports 500 -j ACCEPT
$ipt -t filter -A INPUT -p udp -s $ntp -i $inet_iface --dport 123 -j ACCEPT
$ipt -t filter -A INPUT -i $inet_iface -p gre -j ACCEPT
$ipt -t filter -A INPUT -s $lan_ip_range -i $lan_iface -p gre -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p gre -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p ah -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p esp -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p tcp -m multiport --dports 6160,2049,1863,1723,995,993,445,443,139,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p tcp -m multiport --dports 21064,11111,5989,143,111 -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p udp -m multiport --dports 5405,5404,1863,1194,445,443,138,137,123,113,110,80,69,21,20 -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -p udp -m multiport --dports 500 -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -m state --state NEW -m udp -p udp --dport domain -j ACCEPT
$ipt -t filter -A INPUT -s 192.168.122.0/24 -i virbr0 -m state --state NEW -m tcp -p tcp --dport domain -j ACCEPT
$ipt -t filter -A INPUT -i virbr0 -p udp --dport 67 -j ACCEPT
$ipt -t filter -A INPUT -i virbr0 -p tcp --dport 67 -j ACCEPT
$ipt -t filter -A INPUT -p icmp -m icmp --icmp-type destination-unreachable -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A INPUT -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A INPUT -j REJECT --reject-with icmp-port-unreachable
$ipt -t filter -A INPUT -p tcp -j REJECT --reject-with tcp-reset
$ipt -t filter -A INPUT -j DROP
$ipt -t filter -A FORWARD -s $lan_ip_range -i $inet_iface -j DROP
$ipt -t filter -A FORWARD -s 192.168.122.0/24 -i $inet_iface -j DROP
$ipt -t filter -A FORWARD -s 192.168.0.0/16 -i $inet_iface -j DROP
$ipt -t filter -A FORWARD -s 10.0.0.0/8 -i $inet_iface -j DROP
$ipt -t filter -A FORWARD -s 172.16.0.0/16 -i $inet_iface -j DROP
$ipt -t filter -A FORWARD -s 127.0.0.0/8 -i $inet_iface -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 0:19 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 0:19 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 22:24 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 22:24 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 26:79 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 26:79 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 81:109 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 81:109 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 111:442 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 111:442 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 444 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 444 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 446:1001 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 446:1001 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31790 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31790 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31789 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31789 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31340 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31340 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31339 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31339 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31338 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31338 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31337 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31337 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 31335 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 31335 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 30100 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 30100 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 27665 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 27665 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 27444 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 27444 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 27374 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 27374 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 23445 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 23445 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 23444 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 23444 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 19191 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 19191 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 14704 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 14704 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 10000 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 10000 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 9704 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 9704 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 9393 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 9393 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 8102 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 8102 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 8011 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 8011 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 7626 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 7626 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 7306 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 7306 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 6667 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 6667 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 6346 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 6346 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 6267 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 6267 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 6129 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 6129 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 6000 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 6000 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5900 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5900 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5800 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5800 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5554 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5554 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5400 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5400 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5168 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5168 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5100 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5100 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 5000 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 5000 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 4500 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 4500 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 4444 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 4444 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 3389 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 3389 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 3306 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 3306 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 3150 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 3150 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 3127 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 3127 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 3000 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 3000 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2989 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2989 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2869 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2869 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2500 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2500 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2475 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2475 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2140 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2140 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2115 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2115 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2023 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2023 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2012 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2012 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2001 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2001 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 2000 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 2000 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1981 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1981 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1900 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1900 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1807 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1807 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1600 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1600 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1524 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1524 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1492 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1492 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1444 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1444 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1443 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1443 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1434 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1434 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1349 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1349 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1245 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1245 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1243 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1243 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1234 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1234 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1099 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1099 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1098 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1098 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1097 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1097 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1095 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1095 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1090 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1090 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1080 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1080 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1057 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1057 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1053 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1053 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1051 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1051 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1045 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1045 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1042 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1042 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1025 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1025 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1024 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1024 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1015 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1015 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1012 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1012 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1011 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1011 -j DROP
$ipt -t filter -A FORWARD -p tcp --dport 1010 -j DROP
$ipt -t filter -A FORWARD -p udp --dport 1010 -j DROP
$ipt -t filter -A FORWARD -p icmp -m icmp --icmp-type echo-request -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A FORWARD -p icmp -m icmp --icmp-type echo-reply -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
$ipt -t filter -A FORWARD -p icmp --icmp-type any -m limit --limit 1/sec --limit-burst 10 -j ACCEPT
$ipt -t filter -A FORWARD -f -m limit --limit 150/sec --limit-burst 150 -j ACCEPT
$ipt -t filter -A FORWARD ! -i lo -m state --state NEW,INVALID -j LOG --log-prefix "foriptables:"
$ipt -t filter -A FORWARD -p tcp --tcp-flags ALL ALL -j DROP
$ipt -t filter -A FORWARD -p tcp --tcp-flags ALL NONE -j DROP
$ipt -t filter -A FORWARD -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
$ipt -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$ipt -t filter -A FORWARD -i $inet_iface -o $lan_iface -d $lan_ip_range -m state --state RELATED,ESTABLISHED -j ACCEPT
$ipt -t filter -A FORWARD -i $inet_iface -o virbr0 -d 192.168.122.0/24 -m state --state RELATED,ESTABLISHED -j ACCEPT
$ipt -t filter -A FORWARD -p tcp ! --syn -m state --state NEW -j DROP
$ipt -t filter -A FORWARD -s $lan_ip_range -i $lan_iface -o lo -j ACCEPT
$ipt -t filter -A FORWARD -s 192.168.122.0/24 -i virbr0 -o lo -j ACCEPT
$ipt -t filter -A FORWARD -s $lan_ip_range -i $lan_iface -o $inet_iface -p tcp -m multiport --dports 8000,1863,1723,995,993,445,443,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -i $inet_iface -o $lan_iface -d $lan_ip_range -p tcp -m multiport --dports 8000,1863,1723,995,993,445,443,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -s $lan_ip_range -i $lan_iface -o $inet_iface -p udp -m multiport --dports 8000,1863,445,443,113,110,80,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -i $inet_iface -o $lan_iface -d $lan_ip_range -p udp -m multiport --dports 8000,1863,445,443,113,110,80,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -p gre -i $inet_iface -o $lan_iface -d $lan_ip_range -j ACCEPT
$ipt -t filter -A FORWARD -p gre -s $lan_ip_range -i $lan_iface -o $inet_iface -j ACCEPT
$ipt -t filter -A FORWARD -p udp -i $inet_iface -o $lan_iface -d $lan_ip_range -j ACCEPT
$ipt -t filter -A FORWARD -i $inet_iface -o virbr0 -d 192.168.122.0/24 -p tcp -m multiport --dports 8000,1863,1723,445,443,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -s 192.168.122.0/24 -i virbr0 -o $inet_iface -p tcp -m multiport --dports 8000,1863,1723,445,443,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -i $inet_iface -o virbr0 -d 192.168.122.0/24 -p udp -m multiport --dports 8000,1863,445,443,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -s 192.168.122.0/24 -i virbr0 -o $inet_iface -p udp -m multiport --dports 8000,1863,445,443,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A FORWARD -p gre -i $inet_iface -o virbr0 -d 192.168.122.0/24 -j ACCEPT
$ipt -t filter -A FORWARD -p gre -s 192.168.122.0/24 -i virbr0 -o $inet_iface -j ACCEPT
$ipt -t filter -A FORWARD -p udp -i $inet_iface -o virbr0 -d 192.168.122.0/24 -j ACCEPT
$ipt -t filter -A FORWARD -p icmp -m icmp --icmp-type destination-unreachable -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A FORWARD -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A FORWARD -j REJECT --reject-with icmp-port-unreachable
$ipt -t filter -A FORWARD -p tcp -j REJECT --reject-with tcp-reset
$ipt -t filter -A FORWARD -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 0:19 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 0:19 -j DROP
$ipt -t filter -A OUTPUT -o $inet_iface -p tcp --sport 22 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 22 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 23:24 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 23:24 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 26:52 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 26:52 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 54:66 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 54:66 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 69:79 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 69:79 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 81:109 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 81:109 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 112 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 111:112 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 123 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 114:122 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 114:138 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 124:138 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 140:142 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 144:442 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 140:442 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 444:1001 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 444:1001 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31790 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31790 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31789 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31789 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31340 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31340 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31339 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31339 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31338 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31338 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31337 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31337 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 31335 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 31335 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 30100 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 30100 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 27665 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 27665 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 27444 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 27444 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 27374 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 27374 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 23445 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 23445 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 23444 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 23444 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 19191 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 19191 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 14704 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 14704 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 10000 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 10000 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 9704 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 9704 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 9393 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 9393 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 8102 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 8102 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 8011 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 8011 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 7626 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 7626 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 7306 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 7306 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 6667 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 6667 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 6346 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 6346 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 6267 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 6267 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 6129 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 6129 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 6000 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 6000 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5900 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5900 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5800 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5800 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5554 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5554 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5400 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5400 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5168 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5168 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5100 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5100 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 5000 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 5000 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 4500 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 4500 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 4444 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 4444 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 3389 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 3389 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 3306 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 3306 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 3150 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 3150 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 3127 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 3127 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 3000 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 3000 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2989 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2989 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2869 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2869 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2500 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2500 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2475 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2475 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2140 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2140 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2115 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2115 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2023 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2023 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2012 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2012 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2001 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2001 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 2000 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 2000 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1981 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1981 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1900 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1900 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1807 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1807 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1600 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1600 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1524 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1524 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1492 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1492 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1444 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1444 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1443 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1443 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1434 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1434 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1349 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1349 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1245 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1245 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1243 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1243 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1234 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1234 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1099 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1099 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1098 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1098 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1097 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1097 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1095 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1095 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1090 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1090 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1080 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1080 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1057 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1057 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1053 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1053 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1051 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1051 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1045 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1045 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1042 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1042 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1025 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1025 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1024 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1024 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1015 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1015 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1012 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1012 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1011 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1011 -j DROP
$ipt -t filter -A OUTPUT -p tcp --sport 1010 -j DROP
$ipt -t filter -A OUTPUT -p udp --sport 1010 -j DROP
$ipt -t filter -A OUTPUT -p icmp -m icmp --icmp-type echo-reply -j REJECT --reject-with icmp-host-prohibited
$ipt -t filter -A OUTPUT -o lo -j ACCEPT
$ipt -t filter -A OUTPUT -p tcp -m multiport --dports 8000,6160,5989,1863,1723,995,993,443,143,113,110,80,25,21,20 -j ACCEPT
$ipt -t filter -A OUTPUT -p tcp -m multiport --dports 111 -j ACCEPT
$ipt -t filter -A OUTPUT -p udp -m multiport --dports 8000,1863,443,123,113,110,80,21,20 -j ACCEPT
$ipt -t filter -A OUTPUT -p tcp --sport domain -j ACCEPT
$ipt -t filter -A OUTPUT -p udp --sport domain -j ACCEPT
$ipt -t filter -A OUTPUT -o $lan_iface -p ah -j ACCEPT
$ipt -t filter -A OUTPUT -o $lan_iface -p esp -j ACCEPT
$ipt -t filter -A OUTPUT -o virbr0 -p ah -j ACCEPT
$ipt -t filter -A OUTPUT -o virbr0 -p esp -j ACCEPT
$ipt -t filter -A OUTPUT -o $lan_iface -p tcp -m multiport --dports 21064,11111,2049,445,139,68,67,22 -j ACCEPT
$ipt -t filter -A OUTPUT -o $lan_iface -p udp -m multiport --dports 5405,5404,1194,500,445,139,69,68,67 -j ACCEPT
$ipt -t filter -A OUTPUT -o virbr0 -p tcp -m multiport --dports 21064,11111,2049,445,139,68,67,22 -j ACCEPT
$ipt -t filter -A OUTPUT -o virbr0 -p udp -m multiport --dports 5405,5404,1194,500,445,139,69,68,67 -j ACCEPT
$ipt -t filter -A OUTPUT -o $inet_iface -p gre -j ACCEPT
$ipt -t filter -A OUTPUT -d $lan_ip_range -o $lan_iface -p gre -j ACCEPT
$ipt -t filter -A OUTPUT -d 192.168.122.0/24 -o virbr0 -p gre -j ACCEPT
if [ "$inet_iface" = ppp0 ] ; then
$ipt -t nat -A POSTROUTING -o $inet_iface -j MASQUERADE
else
$ipt -t nat -A POSTROUTING -o $inet_iface -j SNAT --to $inet_ip
fi
$ipt -t nat -A POSTROUTING -s 192.168.122.0/255.255.255.0 -j MASQUERADE
- 保存防火墙配置runing snort.sh
service iptables save
或者
/etc/init.d/iptables save
可以在/var/log/messages文件中查看记录信息。
在crontab中加入如下信息:
# iptables reload(每隔15分钟运行一次防火墙配置)
*/15 * * * * root /etc/rc.d/snort.sh
Fedora-14使用中存在的bug
以下是中文(zh_cn)GNOME2.32.0界面中应用软件存在的bug
- 系统>>管理>>防火墙
防火墙配置>>icmp过滤器>>重新定向
"这个出错信息让主机想另一个路由中发送数据包" 软件中文界面解释中“想”应修改为“向”;完整修改如下: "这个出错信息让主机向另一个路由中发送数据包"
- GNU桌面下计算机>>文件系统>>属性显示内容大小错误128.0TB(没有按实际容量显示系统是否只支持128.0TB硬盘容量)