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

ERL + Dual WAN + OpenVPN policy routing : Any tips / critiques are welcome!

$
0
0

Good Morning All,

 

I am the proud owner of an EdgeRouter Lite which is running EdgeOS 1.8. Its amazing!! Ubnt Banana

 

With the help of the config examples and posts on this forum, I was able to get my beta setup up and running. As a Super-Newbie, I would greatly appreciate it if any of you folks have any comments or suggestions on my config which is working and seems to do what I want it to ..

 

I have two ISPs :

  • Main ISP = Fibre to the Home (FTTH) via the ISP's router which has an IP address of 192.168.100.1. Its not possible to put the device in bridge mode or use PPPOE. I am stuck with NAT here.. 
  • Failover ISP = ADSL modem in bridge mode via PPPOE.

 

What I want the system to do:

  • Send all traffic over the much faster FTTH service, and only use the slow ADSL (1Mbit/256kbit) connection if the FTTH service fails.
  • Traffic from My wife's iPad and the Smart-TV should go through the OpenVPN tunnel. So far I only have one device working Man Sad

Aspects of the Config I am not sure about:

  • Should I Apply the default "WAN_IN" and "WAN_LOCAL" firewall policies to the OpenVPN interface? I decided against doing that for the FTTH as that router has its own firewall which I can't turn off or modify.
  • Did I go about getting the Failover to work with the policy based routing in the best way?

Future Plans ..

  • Getting some QOS action going...
  • Portforwarding the security camera setup via the routable ADSL interface... 

 

Here is my Config file :

 

firewall {
    all-ping enable
    broadcast-ping disable
    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 {
                table main
            }
        }
        rule 20 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth0
                }
            }
            modify {
                table main
            }
        }
        rule 30 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_pppoe1
                }
            }
            modify {
                table main
            }
        }
        rule 40 {
            action modify
            modify {
                lb-group G
            }
        }
        rule 50 {
            action modify
            description "traffic from a device IP goes through Openvpn"
            modify {
                table 1
            }
            source {
                address 10.0.1.131/32
            }
        }
    }
    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
            }
        }
    }
    options {
        mss-clamp {
            mss 1412
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    ethernet eth0 {
        address 192.168.100.254/24
        description "FTTH"
        duplex auto
        speed auto
    }
    ethernet eth1 {
        description "ADSL (backup)"
        duplex auto
        pppoe 1 {
            default-route auto
            firewall {
                in {
                    name WAN_IN
                }
                local {
                    name WAN_LOCAL
                }
            }
            mtu 1492
            name-server auto
            password password
            user-id adsl.username
        }
        speed auto
    }
    ethernet eth2 {
        address 10.0.1.1/24
        description LAN
        duplex auto
        firewall {
            in {
                modify balance
            }
        }
        speed auto
    }
    loopback lo {
    }
    openvpn vtun0 {
        config-file /config/auth/newshostingvpn/newshosting.ovpn
        description Miami_Florida_VPN
    }
}
load-balance {
    group G {
        interface eth0 {
            route-test {
                initial-delay 60
                interval 10
                type {
                    ping {
                        target 8.8.8.8
                    }
                }
            }
        }
        interface pppoe1 {
            failover-only
            route-test {
                initial-delay 60
                interval 10
                type {
                    ping {
                        target 8.8.8.8
                    }
                }
            }
        }
    }
}
protocols {
    static {
        route 0.0.0.0/0 {
            next-hop 192.168.100.1 {
            }
        }
        table 1 {
            interface-route 0.0.0.0/0 {
                next-hop-interface vtun0 {
                }
            }
        }
    }
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name LAN {
            authoritative enable
            subnet 10.0.1.0/24 {
                default-router 10.0.1.1
                dns-server 10.0.1.1
                lease 86400
                start 10.0.1.50 {
                    stop 10.0.1.250
                }
            }
        }
    }
    dns {
        forwarding {
            cache-size 2000
            listen-on eth2
        }
    }
    gui {
        https-port 443
    }
    nat {
        rule 5000 {
            description "masquerade for WAN"
            outbound-interface eth0
            type masquerade
        }
        rule 5001 {
            description "masquerade for VTUN0"
            log disable
            outbound-interface vtun0
            type masquerade
        }
        rule 5002 {
            description "masquerade for WAN 2"
            outbound-interface pppoe1
            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
        }
    }
    domain-name my.lan
    host-name edgerouter
    login {
        user ubnt {
            authentication {
                encrypted-password $6&&&&&&&&&&&&&&&&&&&
            }
            level admin
        }
    }
    name-server 8.8.8.8
    name-server 4.2.2.2
    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 {
        }
    }
    offload {
        ipv4 {
            forwarding enable
            pppoe enable
        }
    }
    syslog {
        global {
            facility all {
                level notice
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone America/Jamaica
    traffic-analysis {
        dpi enable
        export enable
    }
}


/* Warning: Do not remove the following line. */
/* === vyatta-config-version: "config-management@1:conntrack@1:cron@1:dhcp-relay@1:dhcp-server@4:firewall@5:ipsec@5:nat@3:qos@1:quagga@2:system@4:ubnt-pptp@1:ubnt-util@1:vrrp@1:webgui@1:webproxy@1:zone-policy@1" === */
/* Release version: v1.8.0.4853089.160219.1607 */

Thanks for any help / suggestions in advance!

Kind Regards,

 

Rx

 


Viewing all articles
Browse latest Browse all 20028

Trending Articles



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