Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the load status monitor is not loading #4

Closed
sisodiakaran opened this issue Sep 5, 2015 · 6 comments
Closed

the load status monitor is not loading #4

sisodiakaran opened this issue Sep 5, 2015 · 6 comments

Comments

@sisodiakaran
Copy link

Hello @lstein,

I am trying to configure two wlan connections and run load_balance.pl but failed. Below is my configuration:

$ ifconfig

eth0      Link encap:Ethernet  HWaddr 4c:72:b9:31:f5:b3  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:20 Memory:fe200000-fe220000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:14654 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14654 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1873976 (1.8 MB)  TX bytes:1873976 (1.8 MB)

wlan0     Link encap:Ethernet  HWaddr 64:70:02:3b:90:43  
          inet addr:192.168.43.37  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: fe80::6670:2ff:fe3b:9043/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:185939 errors:0 dropped:0 overruns:0 frame:0
          TX packets:131723 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:214728765 (214.7 MB)  TX bytes:16991765 (16.9 MB)

wlan1     Link encap:Ethernet  HWaddr c8:3a:35:ca:31:ad  
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ca3a:35ff:feca:31ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:136 errors:0 dropped:0 overruns:0 frame:0
          TX packets:177 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14938 (14.9 KB)  TX bytes:23897 (23.8 KB)

/etc/network/balance.conf

## Net::ISP::Balance configuration file
## edit it as needed to describe your router setup

## This table defines the LAN and IP services.
## Uncomment by removing hash symbols (#) and then edit as needed

## service    device   role     ping-ip            weight
#CABLE        eth0     isp      173.194.43.95      1
#DSL          ppp0     isp      173.194.43.95      1
#LAN1         eth1     lan      
#LAN2         eth2     lan
WLAN0        wlan0    isp      216.58.196.14       2
WLAN1        wlan1    isp      216.58.196.14        1

## These options are passed to lsm, among others.
## the defaults are shown. To change them, uncomment
## and edit.

#warn_email=root@localhost
#interval_ms=1000
#max_packet_loss=15
#max_successive_pkts_lost=7
#min_packet_loss=5
#min_successive_pkts_rcvd=10
#long_down_time=120

# :isp = all ISPs
# :lan = all LANs
# default routing_group = :lan :isp
#forwarding_group=LAN1 :isp
#forwrding_group=LAN2 :isp

Debug output is:

## Including rules from /etc/network/balance/pre-run/pre-run-script.pl ##
## Finished /etc/network/balance/pre-run/pre-run-script.pl ##
echo 0 > /proc/sys/net/ipv4/ip_forward
ip route flush all
ip rule flush
ip rule add from all lookup main pref 32766
ip rule add from all lookup default pref 32767
ip route flush table  1
ip route flush table  2
ip route add  192.168.43.0/24 dev wlan0 src 192.168.43.37
ip route add  192.168.1.0/24 dev wlan1 src 192.168.1.4
ip route add default scope global nexthop via 192.168.43.1 dev wlan0 weight 2 nexthop via 192.168.43.1 dev wlan1 weight 1 
ip route add table 1 default dev wlan0 via 192.168.43.1
ip route add table 1 192.168.43.0/24 dev wlan0 src 192.168.43.37
ip route add table 1 192.168.1.0/24 dev wlan1 src 192.168.1.4
ip rule add from 192.168.43.37 table 1
ip rule add fwmark 1 table 1
ip route add table 2 default dev wlan1 via 192.168.43.1
ip route add table 2 192.168.43.0/24 dev wlan0 src 192.168.43.37
ip route add table 2 192.168.1.0/24 dev wlan1 src 192.168.1.4
ip rule add from 192.168.1.4 table 2
ip rule add fwmark 2 table 2
## Including rules from /etc/network/balance/routes/01.local_routes ##
# enter any routing commands you might want to go in
# for example:
# ip route add 192.168.100.1 dev eth0 src 198.162.1.14

## Finished /etc/network/balance/routes/01.local_routes ##
## Including rules from /etc/network/balance/routes/02.local_routes.pl ##
## Finished /etc/network/balance/routes/02.local_routes.pl ##
iptables -F
iptables -X
iptables -t nat    -F
iptables -t nat    -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT    DROP
iptables -P OUTPUT   DROP
iptables -P FORWARD  DROP

iptables -N REJECTPERM
iptables -A REJECTPERM -j LOG -m limit --limit 1/minute --log-level 4 --log-prefix "REJECTED: "
iptables -A REJECTPERM -j REJECT --reject-with icmp-net-unreachable

iptables -N DROPGEN
iptables -A DROPGEN -j LOG -m limit --limit 1/minute --log-level 4 --log-prefix "GENERAL: "
iptables -A DROPGEN -j DROP

iptables -N DROPINVAL
iptables -A DROPINVAL -j LOG -m limit --limit 1/minute --log-level 4 --log-prefix "INVALID: "
iptables -A DROPINVAL -j DROP

iptables -N DROPPERM
iptables -A DROPPERM -j LOG -m limit --limit 1/minute --log-level 4 --log-prefix "ACCESS-DENIED: "
iptables -A DROPPERM -j DROP

iptables -N DROPSPOOF
iptables -A DROPSPOOF -j LOG -m limit --limit 1/minute --log-level 4 --log-prefix "DROP-SPOOF: "
iptables -A DROPSPOOF -j DROP

iptables -N DROPFLOOD
iptables -A DROPFLOOD -m limit --limit 1/minute  -j LOG --log-level 4 --log-prefix "DROP-FLOOD: "
iptables -A DROPFLOOD -j DROP

iptables -N DEBUG
iptables -A DEBUG  -j LOG --log-level 3 --log-prefix "DEBUG: "
iptables -t mangle -N MARK-WLAN0
iptables -t mangle -A MARK-WLAN0 -j MARK     --set-mark 1
iptables -t mangle -A MARK-WLAN0 -j CONNMARK --save-mark
iptables -t mangle -N MARK-WLAN1
iptables -t mangle -A MARK-WLAN1 -j MARK     --set-mark 2
iptables -t mangle -A MARK-WLAN1 -j CONNMARK --save-mark
iptables -t mangle -A PREROUTING -i wlan0 -s 192.168.43.0/24 -m conntrack --ctstate NEW -j MARK-WLAN0
iptables -t mangle -A PREROUTING -i wlan0 -s 192.168.43.0/24 -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -i wlan1 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j MARK-WLAN1
iptables -t mangle -A PREROUTING -i wlan1 -s 192.168.1.0/24 -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark
iptables -A INPUT  -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -d 127.0.0.0/8 -j DROPPERM
iptables -A INPUT   -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT   -p tcp --tcp-flags SYN,ACK ACK -j ACCEPT
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK ACK -j ACCEPT
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j DROPFLOOD
iptables -A OUTPUT -o wlan0 -j ACCEPT
iptables -A OUTPUT -o wlan1 -j ACCEPT
iptables -A OUTPUT  -j DROPSPOOF
## Including rules from /etc/network/balance/firewall/01.accept ##
## This file contains iptables statements that add additional firewall rules

# allow incoming domain packets -- needed for DNS resolution
iptables -A INPUT   -p udp --source-port domain -j ACCEPT
# allow incoming NTP packets -- needed for net time protocol
iptables -A INPUT   -p udp --source-port ntp -j ACCEPT
## Finished /etc/network/balance/firewall/01.accept ##
## Including rules from /etc/network/balance/firewall/01.accept.pl ##
## Finished /etc/network/balance/firewall/01.accept.pl ##
## Including rules from /etc/network/balance/firewall/02.forward.pl ##
## Finished /etc/network/balance/firewall/02.forward.pl ##
echo 1 > /proc/sys/net/ipv4/ip_forward
## Including rules from /etc/network/balance/post-run/post-run-script.pl ##
## Finished /etc/network/balance/post-run/post-run-script.pl ##

Is there anything missing in the configuration?

@djeraseit
Copy link

I'm having the same issue. If I run it manually from the command line it works

@djeraseit
Copy link

I edited /usr/share/perl5/site_perl/Net/ISP/Balance/ConfigData.pm and at the bottom of the file pointed it to the path of my lsm. Will test tomorrow and see if this fixes the issue.

@djeraseit
Copy link

Also found a issue with my startup script. I will test again tomorrow.
I now have it set to /usr/bin/perl /etc/load_balance.pl.

Looking at syslog, without the perl prefix, sh was trying to execute the commands in that file directly.

@djeraseit
Copy link

@sisodiakaran try adding a line for your LAN connection to /etc/network/balance.conf

LAN1 eth0 lan

@lstein
Copy link
Owner

lstein commented Nov 18, 2015

Is this issue now fixed? I will close shortly if no confirmation.

@lstein
Copy link
Owner

lstein commented Nov 24, 2015

Closed for now. Please reopen if the problem is persistent.

@lstein lstein closed this as completed Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants