[packages] multiwan: removed resolv_conf settings and added dns server override & updated default config file.

git-svn-id: svn://svn.openwrt.org/openwrt/packages@21249 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
craigc 2010-04-29 04:35:48 +00:00
parent 685168c673
commit 59abbb11d6
3 changed files with 17 additions and 33 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=multiwan PKG_NAME:=multiwan
PKG_VERSION:=1.0m PKG_VERSION:=1.0.1
PKG_RELEASE:=1 PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -1,7 +1,6 @@
config 'multiwan' 'config' config 'multiwan' 'config'
option 'default_route' 'balancer' option 'default_route' 'balancer'
option 'resolv_conf' '/tmp/resolv.conf.auto'
config 'interface' 'wan' config 'interface' 'wan'
option 'weight' '10' option 'weight' '10'
@ -10,7 +9,8 @@ config 'interface' 'wan'
option 'timeout' '3' option 'timeout' '3'
option 'health_fail_retries' '3' option 'health_fail_retries' '3'
option 'health_recovery_retries' '5' option 'health_recovery_retries' '5'
option 'failover_to' 'balancer' option 'failover_to' 'wan2'
option 'dns' 'auto'
config 'interface' 'wan2' config 'interface' 'wan2'
option 'weight' '10' option 'weight' '10'
@ -19,34 +19,12 @@ config 'interface' 'wan2'
option 'timeout' '3' option 'timeout' '3'
option 'health_fail_retries' '3' option 'health_fail_retries' '3'
option 'health_recovery_retries' '5' option 'health_recovery_retries' '5'
option 'failover_to' 'wan3' option 'failover_to' 'balancer'
option 'dns' '208.67.222.222 208.67.220.220'
config 'interface' 'wan3'
option 'weight' 'disable'
option 'health_interval' 'disable'
option 'icmp_hosts' 'gateway'
option 'timeout' '3'
option 'health_fail_retries' '3'
option 'health_recovery_retries' '5'
option 'failover_to' 'disable'
config 'interface' 'wan4'
option 'weight' '3'
option 'health_interval' '20'
option 'icmp_hosts' '208.67.222.222 208.67.220.220'
option 'timeout' '3'
option 'health_fail_retries' '3'
option 'health_recovery_retries' '5'
option 'failover_to' 'wan'
config 'mwanfw' config 'mwanfw'
option 'src' '192.168.1.0/24' option 'src' '192.168.1.0/24'
option 'dst' 'ftp.netlab7.com' option 'dst' 'ftp.netlab7.com'
option 'proto' 'tcp'
option 'ports' '21'
option 'wanrule' 'wan4'
config 'mwanfw'
option 'proto' 'tcp' option 'proto' 'tcp'
option 'ports' '21' option 'ports' '21'
option 'wanrule' 'wan2' option 'wanrule' 'wan2'

View File

@ -445,14 +445,13 @@ local gateway
local ifname local ifname
local failchk local failchk
local compile_dns local compile_dns
local resolv_conf
local dns_server local dns_server
local i local i
iptables -F MultiWanDNS -t mangle iptables -F MultiWanDNS -t mangle
rm $resolv_conf rm /tmp/resolv.conf.auto
touch $resolv_conf touch /tmp/resolv.conf.auto
echo "## Refreshing DNS Resolution and Tables ##" echo "## Refreshing DNS Resolution and Tables ##"
@ -465,7 +464,12 @@ ipaddr=$(query_config ipaddr $group)
ifname=$(query_config ifname $group) ifname=$(query_config ifname $group)
failchk=$(query_config failchk $group) failchk=$(query_config failchk $group)
dns=`uci -q -P /var/state get multiwan.${group}.dns`
if [ -z "$dns" -o "$dns" == "auto" ]; then
dns=`uci -q -P /var/state get network.${group}.dns` dns=`uci -q -P /var/state get network.${group}.dns`
fi
dns=$(echo $dns | sed -e "s/ /\n/g") dns=$(echo $dns | sed -e "s/ /\n/g")
if [ ! -z "$dns" -a "$failchk" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" -a "$ifname" != "x" ]; then if [ ! -z "$dns" -a "$failchk" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" -a "$ifname" != "x" ]; then
@ -474,7 +478,7 @@ do
iptables -t mangle -A MultiWanDNS -d $dns_server -j FW${i}MARK iptables -t mangle -A MultiWanDNS -d $dns_server -j FW${i}MARK
compile_dns="nameserver $dns_server" compile_dns="nameserver $dns_server"
echo "$compile_dns" >> $resolv_conf echo "$compile_dns" >> /tmp/resolv.conf.auto
done done
fi fi
done done
@ -832,7 +836,10 @@ if [ "$icmp_hosts" != "disable" -a "$ifname" != "x" -a "$ipaddr" != "x" -a "$gat
if [ "$icmp_hosts" == "gateway" -o -z "$icmp_hosts" ]; then if [ "$icmp_hosts" == "gateway" -o -z "$icmp_hosts" ]; then
icmp_hosts_acquire=$gateway icmp_hosts_acquire=$gateway
elif [ "$icmp_hosts" == "dns" ]; then elif [ "$icmp_hosts" == "dns" ]; then
icmp_hosts_acquire=`uci -q -P /var/state get network.$1.dns` icmp_hosts_acquire=`uci -q -P /var/state get multiwan.$1.dns`
if [ -z "$icmp_hosts_acquire" -o "$icmp_hosts_acquire" == "auto" ]; then
icmp_hosts_acquire=`uci -q -P /var/state get network.$1.dns`
fi
else else
icmp_hosts_acquire=$icmp_hosts icmp_hosts_acquire=$icmp_hosts
fi fi
@ -940,7 +947,6 @@ wancount=0
config_clear config_clear
config_load "multiwan" config_load "multiwan"
config_get default_route config default_route config_get default_route config default_route
config_get resolv_conf config resolv_conf
config_get debug config debug config_get debug config debug
config_foreach acquire_wan_data interface config_foreach acquire_wan_data interface