- 论坛徽章:
- 0
|
公司使用一台pc PIIII 512M 80G*2 安装linux 8(2.4.1,机器配置双网卡eth0一块连接到 ADSL modem, 一块eth1 连接到公司交换机, 使用下面方法做代理服务半年
1.安装pppoe 拨号程序 rp-pppoe-3.4-7.i386.rpm
2.修改 /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4=yes
HOSTNAME=server
GATEWAY=192.168.0.1
GATEWAYDEV=eth1
3. 利用iptables的写如下脚本
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
echo 1 >; /proc/sys/net/ipv4/ip_forward
/sbin/iptables -F INPUT
/sbin/iptables -F FORWARD
/sbin/iptables -F POSTROUTING -t nat
/sbin/iptables -P FORWARD DROP
/sbin/iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
/sbin/iptables -A FORWARD -i ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.0/24 -j MASQUERADE
/sbin/iptables -A INPUT -p tcp -i ppp0 --syn --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -i ppp0 --syn -j DROP
把以上脚本加入到 /etc/rc.d/rc.local 使其开机运行
两周前突然不能正常实现代理功能,pppoe拨号正常,但是内部所有的不能通过其实现上网的功能。
查阅有关文档,发现以前的文档中要求内核中
在General setup中
设Networking Support 为ON
在Networking Options中
设Network firewalls为 ON
设TCP/IP Networking为 ON
设IP forwarding/gatewaying为 OFF (除非要用IP过滤)
设IP Firewalling为ON
设IP firewall packet loggin为 ON(不是必需,设了更好)
设IP: masquerading 为OFF(不属本文范围)
设IP: accounting 为ON
设IP: tunneling 为OFF
设IP: aliasing 为OFF
设IP: PC/TCP compatibility mode 为OFF
设 IP: Reverse ARP 为OFF
设Drop source routed frames 为ON
在Network device support项下
设Network device support 为ON
设Dummy net driver support 为ON
设Ethernet (10 or 100Mbit) 为ON
选择网卡
我却发现在
在Networking Options中
设Network firewalls为 ON
设TCP/IP Networking为 ON
设IP forwarding/gatewaying为 OFF (除非要用IP过滤)
设IP Firewalling为ON
设IP firewall packet loggin为 ON(不是必需,设了更好)
设IP: masquerading 为OFF(不属本文范围)
设IP: accounting 为ON
设IP: tunneling 为OFF
设IP: aliasing 为OFF
设IP: PC/TCP compatibility mode 为OFF
设 IP: Reverse ARP 为OFF
设Drop source routed frames 为ON
多数的选项没有 ,更无法配置ON 或 off
我该如何做,有什么办法可以检查防火墙设置。 |
|