Changeset 21973


Ignore:
Timestamp:
2010-06-28T06:49:55+02:00 (7 years ago)
Author:
craigc
Message:

[packages]: multiwan:
Repositioned MultiWan tables within iptables list.
Added lan_if setting to change the main routing table to point towards a lan interface instead.

Location:
packages/net/multiwan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • packages/net/multiwan/Makefile

    r21900 r21973  
    99 
    1010PKG_NAME:=multiwan 
    11 PKG_VERSION:=1.0.14 
     11PKG_VERSION:=1.0.15 
    1212PKG_RELEASE:=1 
    1313 
  • packages/net/multiwan/files/etc/config/multiwan

    r21448 r21973  
    22config 'multiwan' 'config' 
    33        option 'default_route' 'balancer' 
     4        option 'lan_if' 'lan' 
    45 
    56config 'interface' 'wan' 
  • packages/net/multiwan/files/usr/bin/multiwan

    r21900 r21973  
    601601fi 
    602602 
     603iptables -t mangle -A MultiWan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark 
     604iptables -t mangle -A MultiWan -j MultiWanPreHandler 
     605iptables -t mangle -A MultiWan -j MultiWanRules 
     606iptables -t mangle -A MultiWan -j MultiWanLoadBalancer 
     607iptables -t mangle -A MultiWan -j MultiWanDNS 
     608iptables -t mangle -A MultiWan -j MultiWanPostHandler 
     609 
    603610iptables -t mangle -I PREROUTING -j MultiWan 
    604 iptables -t mangle -I PREROUTING 2 -j MultiWanPreHandler 
    605 iptables -t mangle -I PREROUTING 3 -j MultiWanRules 
    606 iptables -t mangle -I PREROUTING 4 -j MultiWanLoadBalancer 
    607 iptables -t mangle -I PREROUTING 5 -j MultiWanDNS 
    608  
    609  
    610611iptables -t mangle -I FORWARD -j MultiWan 
    611  
    612612iptables -t mangle -I OUTPUT -j MultiWan 
    613 iptables -t mangle -I OUTPUT 2 -j MultiWanRules 
    614 iptables -t mangle -I OUTPUT 3 -j MultiWanLoadBalancer 
    615 iptables -t mangle -I OUTPUT 4 -j MultiWanPostHandler 
    616 iptables -t mangle -I OUTPUT 5 -j MultiWanDNS 
    617  
    618  
    619613iptables -t mangle -I POSTROUTING -j MultiWan 
    620 iptables -t mangle -I POSTROUTING 2 -j MultiWanPostHandler 
    621  
    622 iptables -t mangle -A MultiWan -j CONNMARK --restore-mark 
     614 
    623615 
    624616refresh_dns 
     
    646638 
    647639if [ ! -z "$CHKFORQOS" ]; then 
    648 iptables -t mangle -I PREROUTING 6 -j MultiWanQoS 
    649 iptables -t mangle -A FORWARD -j MultiWanQoS 
    650 iptables -t mangle -A OUTPUT -j MultiWanQoS 
    651 iptables -t mangle -A POSTROUTING -j MultiWanQoS 
    652 fi 
     640iptables -t mangle -A MultiWan -j MultiWanQoS 
     641fi 
     642 
    653643} 
    654644 
     
    743733local ifname 
    744734local ipaddr 
     735local lanip 
    745736local i 
    746737 
     
    755746ifname=$(query_config ifname $group) 
    756747ipaddr=$(query_config ipaddr $group) 
    757  
    758748ip route flush table $(expr $i + 170) > /dev/null 2>&1 
    759749 
     
    768758if [ "$gateway" != "x" -a "$ipaddr" != "x" -a "$ifname" != "x" ]; then 
    769759ip route add default via $gateway table $(expr $i + 170) src $ipaddr proto static 
    770 route add default gw $gateway dev $ifname  
     760ip route del default > /dev/null 2>&1 
     761 
     762   if [ ! -z $lan_if ]; then 
     763      lanip=`uci -q -P /var/state get network.${lan_if}.ipaddr` 
     764   else 
     765      lanip=`uci -q -P /var/state get network.lan.ipaddr` 
     766   fi 
     767 
     768ip route add default via $lanip > /dev/null 2>&1 
    771769fi 
    772770done 
     
    10671065config_load "multiwan" 
    10681066config_get default_route    config default_route 
     1067config_get lan_if           config lan_if 
    10691068config_get debug            config debug  
    10701069 
Note: See TracChangeset for help on using the changeset viewer.