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

497 posts

Ultimate Geek


#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
Affiliate link
 
 
 

Affiliate link: Life360 protects each family member with advanced driving, digital, and location safety features. Choose the plan that fits your family’s size and life stage.
Azzura

497 posts

Ultimate Geek


  #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
25162 posts

Uber Geek

Trusted
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 »

D-Link G415 4G Smart Router Review
Posted 27-Jun-2022 17:24


New Zealand Video Game Sales Reaches $540 Million
Posted 26-Jun-2022 14:49


Github Copilot Generally Available to All Developers
Posted 26-Jun-2022 14:37


Logitech G Introduces the New Astro A10 Headset
Posted 26-Jun-2022 14:20


Fitbit introduces Sleep Profiles
Posted 26-Jun-2022 14:11


Synology Introduces FlashStation FS3410
Posted 26-Jun-2022 14:04


Intel Arc A380 Graphics First Available in China
Posted 15-Jun-2022 17:08


JBL Introduces PartyBox Encore Essential Speaker
Posted 15-Jun-2022 17:05


New TVNZ+ streaming brand launches
Posted 13-Jun-2022 08:35


Chromecast With Google TV Review
Posted 10-Jun-2022 17:10


Xbox Gaming on Your Samsung Smart TV No Console Required
Posted 10-Jun-2022 00:01


Xbox Cloud Gaming Now Available in New Zealand
Posted 10-Jun-2022 00:01


HP Envy Inspire 7900e Review
Posted 9-Jun-2022 20:31


Philips Hue Starter Kit Review
Posted 4-Jun-2022 11:10


Sony Expands Its Wireless Speaker X-series Range
Posted 4-Jun-2022 10:25









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.