- 论坛徽章:
- 0
|
大家帮帮忙 准备做公司代理服务器(50台机子)
哦,我说呢,MASQ是ipchains用到的,iptables是MASQUERADE,况且FORWARD链里面应该是ACCEPT才对
2年前接触过ipchains,都忘记了……
我根据你的情况,给你写一个script好了,你用chmod加上x权限,放到/etc/rc.local里面执行就OK了
- #! /bin/bash
- modprobe ip_conntrack_ftp
- modprobe ip_nat_ftp
- iptables -P INPUT DROP
- iptables -P FORWARD ACCEPT
- iptables -F
- iptables -F -t nat
- echo 1 >; /proc/sys/net/ipv4_forward
- iptables -A INPUT -i eth0 -s 10.6.8.0/24 -p tcp --dport 22 -j ACCEPT
- iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- iptables -t nat -A POSTROUTING -s 10.6.8.0/24 -o eth1 -j SNAT --to `ifconfig eth1|grep inet|awk '{print $2}'|awk -F: '{print $2}'`
复制代码 |
|