Quantcast
Channel: EdgeRouter topics
Viewing all articles
Browse latest Browse all 20028

ERL Failover with VLANs

$
0
0

So, I'm trying to setup an ERL with failover AND VLans.  The failover I seem to have figured out... but when I add vlans into the mix stuff doesn't work.

 

I used the loadbalancing wizard.  eth0 is lan eth1-2 are WAN.

 

I setup some VLANs so I could test this all out with what I need to do and whenever I have both WAN ports connected, none of the VLANs can get out to the internet.  If I disconnect eth2 then internet starts working again.  I can't figure it out.  If I am connected to just eth0 on no VLAN or VLAN 1 then everything works fine.

 

Here is my config.  I am beating my head on this one!!

firewall {
    all-ping enable
    broadcast-ping disable
    group {
        network-group PRIVATE_NETS {
            description "Priviate LAN Networks"
            network 192.168.1.0/24
            network 192.168.30.0/24
            network 192.168.40.0/24
            network 192.168.50.0/24
            network 192.168.0.0/24
            network 192.168.2.0/24
            network 192.168.3.0/24
            network 192.168.4.0/24
            network 192.168.5.0/24
            network 192.168.20.0/24
        }
    }
    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 {
                table main
            }
        }
        rule 30 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth1
                }
            }
            modify {
                table main
            }
        }
        rule 40 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth2
                }
            }
            modify {
                table main
            }
        }
        rule 100 {
            action modify
            modify {
                lb-group G
            }
        }
    }
    name Eth0_In {
        default-action accept
        description "Eth0 to Other LANs"
        rule 2 {
            action drop
            description "Drop Other LANs"
            destination {
                group {
                    network-group PRIVATE_NETS
                }
            }
            log disable
            protocol all
            source {
                group {
                }
            }
        }
    }
    name Eth0_Local {
        default-action accept
        description "Eth0 to Router"
    }
    name VLAN20_In {
        default-action accept
        description "Eth0 to Other LANs"
        rule 1 {
            action drop
            description "Drop Other LANs"
            destination {
                group {
                    network-group PRIVATE_NETS
                }
            }
            log disable
            protocol all
            source {
                group {
                }
            }
        }
    }
    name VLAN20_Local {
        default-action accept
        description "Eth0 to Router"
    }
    name VLAN30_In {
        default-action accept
        description "Eth0 to Other LANs"
        rule 1 {
            action drop
            description "Drop Other LANs"
            destination {
                group {
                    network-group PRIVATE_NETS
                }
            }
            log disable
            protocol all
            source {
                group {
                }
            }
        }
    }
    name VLAN30_Local {
        default-action accept
        description "Eth0 to Other LANs"
    }
    name VLAN40_In {
        default-action accept
        description "Eth0 to Other LANs"
        rule 1 {
            action drop
            description "Drop Other LANs"
            destination {
                group {
                    network-group PRIVATE_NETS
                }
            }
            log disable
            protocol all
            source {
                group {
                }
            }
        }
    }
    name VLAN40_Local {
        default-action accept
        description "Eth0 to Other LANs"
    }
    name VLAN50_In {
        default-action accept
        description "Eth0 to Other LANs"
        rule 1 {
            action drop
            description "Drop Other LANs"
            destination {
                group {
                    network-group PRIVATE_NETS
                }
            }
            log disable
            protocol all
            source {
                group {
                }
            }
        }
    }
    name VLAN50_Local {
        default-action accept
        description "Eth0 to Other LANs"
    }
    name WAN_IN {
        default-action drop
        description "WAN to LAN"
        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 192.168.1.1/24
        description LAN
        duplex auto
        firewall {
            in {
                modify balance
                name Eth0_In
            }
            local {
                name Eth0_Local
            }
        }
        speed auto
        vif 20 {
            address 192.168.20.1/24
            description "VLAN 20"
            firewall {
                in {
                    name VLAN20_In
                }
                local {
                    name VLAN20_Local
                }
            }
            mtu 1500
        }
        vif 30 {
            address 192.168.30.1/24
            description "VLAN 30"
            firewall {
                in {
                    name VLAN30_In
                }
                local {
                    name VLAN30_Local
                }
            }
            mtu 1500
        }
        vif 40 {
            address 192.168.40.1/24
            description "VLAN 40"
            firewall {
                in {
                    name VLAN40_In
                }
                local {
                    name VLAN40_Local
                }
            }
            mtu 1500
        }
        vif 50 {
            address 192.168.50.1/24
            description "VLAN 50"
            firewall {
                in {
                    name VLAN50_In
                }
                local {
                    name VLAN50_Local
                }
            }
            mtu 1500
        }
    }
    ethernet eth1 {
        address dhcp
        description "Primary WAN"
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    ethernet eth2 {
        address dhcp
        description "Secondary WAN"
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    loopback lo {
    }
}
load-balance {
    group G {
        interface eth1 {
            route-test {
                count {
                    failure 3
                }
                initial-delay 120
                interval 15
            }
        }
        interface eth2 {
            failover-only
        }
    }
}
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.50 {
                    stop 192.168.1.150
                }
            }
        }
        shared-network-name VLAN_20 {
            subnet 192.168.20.0/24 {
                default-router 192.168.20.1
                dns-server 192.168.20.1
                start 192.168.20.25 {
                    stop 192.168.20.250
                }
            }
        }
        shared-network-name VLAN_30 {
            subnet 192.168.30.0/24 {
                default-router 192.168.30.1
                dns-server 192.168.30.1
                start 192.168.30.25 {
                    stop 192.168.30.250
                }
            }
        }
        shared-network-name VLAN_40 {
            subnet 192.168.40.0/24 {
                default-router 192.168.40.1
                dns-server 192.168.40.1
                start 192.168.40.25 {
                    stop 192.168.40.250
                }
            }
        }
        shared-network-name VLAN_50 {
            subnet 192.168.50.0/24 {
                default-router 192.168.50.1
                dns-server 192.168.50.1
                start 192.168.50.25 {
                    stop 192.168.50.250
                }
            }
        }
    }
    dns {
        forwarding {
            cache-size 150
            listen-on eth0.20
            listen-on eth0.30
            listen-on eth0.40
            listen-on eth0.50
            listen-on eth0
        }
    }
    gui {
        https-port 443
    }
    nat {
        rule 5002 {
            description "Masquerade for Primary WAN"
            log disable
            outbound-interface eth1
            protocol all
            source {
                group {
                }
            }
            type masquerade
        }
        rule 5004 {
            description "masquerade for WAN 2"
            outbound-interface eth2
            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 TestRouter
    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
}

Viewing all articles
Browse latest Browse all 20028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>