Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Azzura

603 posts

Ultimate Geek

ID Verified

#210367 24-Mar-2017 14:02
Send private message

With the edgerouter, I have 2 internet connections from 2 diff isps in load balance. I am trying to force some devices/computers to use one wan1 and other devices use wan2. Both wan1 and wan2 in failover mode.

 

 

 

I've got it configured (the best I can tell via UBNT forums)...but the devices still keep jumping from one wan to the other and then back. I am kind of new to these edgerouters. This is something I have probably spent 18 to 20 hours trying to complete.

 

 

 

Please anyone help!

 

Configuration below:

 

firewall {                                                                                                 
    all-ping enable                                                                                        
    broadcast-ping disable                                                                                 
    group {                                                                                                
        address-group 4G_group {                                                                           
            address 192.168.1.38                                                                           
            description "Devices using 4G"                                                                 
        }                                                                                                  
        address-group my_minions {                                                                         
            address 192.168.1.100                                                                          
            description "Spark Group"                                                                      
        }                                                                                                  
        network-group PRIVATE_NETS {                                                                       
            network 192.168.0.0/16                                                                         
            network 172.16.0.0/12                                                                          
            network 10.0.0.0/8                                                                             
        }                                                                                                  
    }                                                                                                      
    ipv6-receive-redirects disable                                                                         
    ipv6-src-route disable                                                                                 
    ip-src-route disable                                                                                   
    log-martians disable                                                                                   
    modify balance {                                                                                       
        rule 10 {
            action modify
            description "do NOT load balance lan to lan"
            destination {
                group {
                    network-group PRIVATE_NETS
                }
            }
            modify {
                lb-group Spark
            }
            source {
                group {
                    address-group my_minions
                }
            }
        }
        rule 20 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth0
                }
            }
            modify {
                lb-group G
            }
            source {
                group {
                    address-group 4G_group
                }
            }
        }
        rule 30 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth1
                }
            }
            modify {
                table main
            }
        }
        rule 100 {
            action modify
            modify {
                table main
            }
            source {
                group {
                }
            }
        }
    }
    name WAN_IN {
        default-action drop
        description "WAN to internal"
        rule 10 {
            action accept
            description "Allow established/related"
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"
            state {
                invalid enable
            }
        }
    }
    name WAN_LOCAL {
        default-action drop
        description "WAN to router"
        rule 10 {
            action accept
            description "Allow established/related"
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"
            state {
                invalid enable
            }
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    ethernet eth0 {
        address dhcp
        description 4G
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    ethernet eth1 {
        address dhcp
        description Spark
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    ethernet eth2 {
        address 192.168.1.1/24
        description Local
        duplex auto
        firewall {
            in {
                modify balance
            }
        }
        speed auto
    }
    ethernet eth3 {
        duplex auto
        speed auto
    }
    ethernet eth4 {
        duplex auto
        speed auto
    }
    ethernet eth5 {
        duplex auto
        speed auto
    }
    ethernet eth6 {
        duplex auto
        speed auto
    }
    ethernet eth7 {
        duplex auto
        speed auto
    }
    loopback lo {
    }
}
load-balance {
    group G {
        interface eth0 {
        }
        interface eth1 {
            failover-only
        }
        lb-local enable
        sticky {
            dest-addr enable
            dest-port enable
            proto enable
            source-addr enable
            source-port enable
        }
    }
    group Spark {
        interface eth0 {
            failover-only
        }
        interface eth1 {
        }
        lb-local enable
        sticky {
            dest-addr enable
            dest-port enable
            proto enable
            source-addr enable
            source-port enable
        }
    }
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name LAN {
            authoritative enable
            subnet 192.168.1.0/24 {
                default-router 192.168.1.1
                dns-server 192.168.1.1
                lease 86400
                start 192.168.1.38 {
                    stop 192.168.1.243
                }
                static-mapping GamingRig {
                    ip-address 192.168.1.100
                    mac-address BC:5F:F4:BF:34:04
                }
                static-mapping Note4 {
                    ip-address 192.168.1.38
                    mac-address C0:BD:D1:18:8C:70
                }
            }
        }
        use-dnsmasq disable
    }
    dns {
        forwarding {
            cache-size 150
            listen-on eth2
        }
    }
    gui {
        http-port 80
        https-port 443
        older-ciphers enable
    }
    nat {
        rule 5000 {
            description "masquerade for WAN"
            outbound-interface eth0
            type masquerade
        }
        rule 5002 {
            description "masquerade for WAN 2"
            outbound-interface eth1
            type masquerade
        }
    }
    ssh {
        port 22
        protocol-version v2
    }
}
system {
    conntrack {
        expect-table-size 4096
        hash-size 4096
        table-size 32768
        tcp {
            half-open-connections 512
            loose enable
            max-retrans 3
        }
    }
    host-name ****
    login {
        user ***** {
            authentication {
                encrypted-password ****************
            }
            level admin
        }
    }
    ntp {
        server 0.ubnt.pool.ntp.org {
        }
        server 1.ubnt.pool.ntp.org {
        }
        server 2.ubnt.pool.ntp.org {
        }
        server 3.ubnt.pool.ntp.org {
        }
    }
    syslog {
        global {
            facility all {
                level notice
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone UTC
    traffic-analysis {
        dpi enable
        export enable
    }

 

 

 

Load Balance Status:

 

Group G
interface : eth0
carrier : up
status : active
gateway : 192.168.4.1
route table : 201
weight : 100%
flows
WAN Out : 0
WAN In : 0
Local Out : 625

 


interface : eth1
carrier : up
status : failover
gateway : 192.168.3.1
route table : 202
weight : 0%
flows
WAN Out : 0
WAN In : 0
Local Out : 0

 


Group Spark
interface : eth1
carrier : up
status : active
gateway : 192.168.3.1
route table : 204
weight : 100%
flows
WAN Out : 2422
WAN In : 0
Local Out : 0

 


interface : eth0
carrier : up
status : failover
gateway : 192.168.4.1
route table : 203
weight : 0%
flows
WAN Out : 0
WAN In : 0
Local Out : 0

 

 

 

Load Balance Watchdog

 

Group G eth0 status: Running pings: 214 fails: 0 run fails: 0/3 route drops: 0 ping gateway: ping.ubnt.com - REACHABLE

 

 

 

eth1 status: Running failover-only mode pings: 215 fails: 0 run fails: 0/3 route drops: 0 ping gateway: ping.ubnt.com - REACHABLE   Group Spark eth0 status: Running failover-only mode pings: 214 fails: 0 run fails: 0/3 route drops: 0 ping gateway: ping.ubnt.com - REACHABLE

 

 

 

eth1 status: Running pings: 215 fails: 0 run fails: 0/3 route drops: 0 ping gateway: ping.ubnt.com - REACHABLE    


Create new topic
Azzura

603 posts

Ultimate Geek

ID Verified

  #1747211 24-Mar-2017 17:13
Send private message

I think I have it solved! I just found a reddit post and it mentioned/showed something that others failed to mention. Just in case there is another person trying or someday trying to do this.

 

All I had to do was basically the same as what I have above.... but add in one more firewall rule (5) and edits to rule 100 :

 

firewall

 

modify balance {
rule 5 {
modify {
lb-group Spark
}
source {
group {
address-group my_minions
}
}
}
rule 10 {
action modify
description "do NOT load balance lan to lan"
destination {
group {
network-group PRIVATE_NETS
}
}
modify {
table main
}
source {
group {
}
}
}
rule 20 {
action modify
description "do NOT load balance destination public address"
destination {
group {
address-group ADDRv4_eth0
}
}
modify {
table main
}
source {
group {
}
}
}
rule 30 {
action modify
description "do NOT load balance destination public address"
destination {
group {
address-group ADDRv4_eth1
}
}
modify {
table main
}
}
rule 100 {
action modify
modify {
lb-group G
}
source {
group {
address-group 4G_group

 

 

 

It is working like a charm. If some one sees something wrong...let me know?

 

 

 

Hope this helps someone..someday.

 

 




richms
28218 posts

Uber Geek

Trusted
Lifetime subscriber

  #1747217 24-Mar-2017 17:24
Send private message

This is something that I was wanting to do on my USG when I had 2 connections and kept running into dead ends on. Shame they dont make it as easy as it should be to do things like this.





Richard rich.ms

Create new topic





News and reviews »

Gen Threat Report Reveals Rise in Crypto, Sextortion and Tech Support Scams
Posted 7-Aug-2025 13:09


Logitech G and McLaren Racing Sign New, Expanded Multi-Year Partnership
Posted 7-Aug-2025 13:00


A Third of New Zealanders Fall for Online Scams Says Trend Micro
Posted 7-Aug-2025 12:43


OPPO Releases Its Most Stylish and Compact Smartwatch Yet, the Watch X2 Mini.
Posted 7-Aug-2025 12:37


Epson Launches New High-End EH-LS9000B Home Theatre Laser Projector
Posted 7-Aug-2025 12:34


Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.