1.安裝相關元件
yum install elinks gcc ncurses-devel
2.下載iptables套件
cd /usr/local/src
elinks netfilter.org
下載iptables-1.3.8.tar.bz2 (選擇最新版本)elinks netfilter.org
3.解壓縮元件
cd /usr/local/src
tar -jxvf iptables-1.3.8.tar.bz2
tar -jxvf iptables-1.3.8.tar.bz2
4.安裝iptables
cd /usr/local/src/iptables-1.3.8
chmod 777 ./extensions/.*
make KERNEL_DIR=/usr/src/linux
make install KERNEL_DIR=/usr/src/linux
make install-devel
chmod 777 ./extensions/.*
make KERNEL_DIR=/usr/src/linux
make install KERNEL_DIR=/usr/src/linux
make install-devel
5.修改iptables路徑
cd /sbin
mv iptables iptables.old
ln -s /usr/local/sbin/iptables iptables
mv iptables iptables.old
ln -s /usr/local/sbin/iptables iptables
6.編輯rc.local
vim /etc/rc.d/rc.local
echo 1 > /proc/sys/net/ipv4/ip_forward
sh /etc/iptables.rule
sh /etc/iptables.rule
7.編輯iptables規則於/etc/
vim /etc/iptables.rule
8.執行iptables規則
sh /etc/iptables.rule
0 意見:
張貼留言