mis_router 发表于 2006-6-28 11:18:41

如果光纖掉線,可不可以直接切到ADSL

?是我的光??的如果光???那天掉?可不可以自?切到adsl上?啊




#!/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.

var/lock/subsys/local
#******Start set var**********
WAN_IP="192.168.8.22"
LAN_IP="192.168.8.23"
LAN_NET="192.168.8.0/24"
#****** End set var **********

#and you can modify "/etc/sysctl.conf"
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "81920" > /proc/sys/net/ipv4/ip_conntrack_max
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe iptable_filter
modprobe iptable_nat
modprobe ip_nat_ftp
#modprobe ip_nat_pptp
#modprobe ip_conntrack_proto_gre
iptables -F
iptables -X
iptables -Z
iptables -F -t nat
iptables -X -t nat
iptables -Z -t nat
iptables -P INPUT   ACCEPT
iptables -P OUTPUTACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -P PREROUTINGACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT      ACCEPT
iptables -t filter -A INPUT   -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A FORWARD -o eth1 -p all -j ACCEPT

#*************************Start open localhost service's port****************************
#iptables -t filter -A INPUT -p icmp --icmp-type 8 -j ACCEPT            # Ping answer
iptables -t filter -A INPUT -i eth0 -p tcp--dport22    -j ACCEPT    # SSH
iptables -t filter -A INPUT -i eth0 -p udp--dport53    -j ACCEPT    # DNS
iptables -t filter -A INPUT -i eth0 -p tcp--dport53    -j ACCEPT    # DNS
iptables -t filter -A INPUT -i eth0 -p tcp--dport 113    -j ACCEPT    # auth
#iptables -t filter -A INPUT -i eth0 -p tcp --dport 25   -j ACCEPT    # SMTP
#iptables -t filter -A INPUT -i eth0 -p tcp --dport 110    -j ACCEPT    # POP3
#iptables -t filter -A INPUT -i eth0 -p tcp --dport 80   -j ACCEPT    # WWW
#iptables -t filter -A INPUT -i eth0 -p tcp --dport 443    -j ACCEPT    # WWW
#*************************End open localhost service's port******************************


#**********************************Start Add Routing*************************************
#Route to Taibei chenbro
route add -net 172.22.16.0 netmask 255.255.240.0 gw 192.168.8.251
#Route to Taoyuan chenbro
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.8.251
#Route to Dongguan chenbro
route add -net 172.22.80.0 netmask 255.255.240.0 gw 192.168.8.251
#***********************************End Add Routing**************************************

#*******************************Start Internet control center****************************
#________________________________________________________
#   User Name         | Type |   MAC Address   | MARK
#________________________________________________________
#K0035                  PC      00:16:76:2C:5B:24
#C0242                  NB      00:0c:29:c7:3d:9e
#TEST                   NB      00:0c:6e:4b:07:d9
#______________________________________________________
MAC="
00:16:76:2C:5B:24
00:0c:29:c7:3d:9e
00:0c:6e:4b:07:d9
"
for i in $MAC
do
iptables -t filter -A FORWARD -p all -m mac --mac-source $i -j ACCEPT
done
#*******************************End Internet control center******************************
页: [1]
查看完整版本: 如果光纖掉線,可不可以直接切到ADSL