Quantcast
Channel: All EdgeRouter posts
Viewing all articles
Browse latest Browse all 60861

Re: Using spamhaus lists

$
0
0

Yes, that's how I did it. Perhaps at this point, it's easiest to just post the config...the items in red are what I added to try to get this working -- of course I have the script as well, but the script isn't completing.

firewall {
    all-ping enable
    broadcast-ping disable
    group {
        network-group LAN_NETS {
            network 192.168.1.0/24
            network 192.168.2.0/24
            network 192.168.3.0/24
            network 192.168.4.0/24
            network 192.168.6.0/24
        }
        network-group Private_networks {
            description RFC1918_networks
            network 192.168.0.0/16
            network 172.16.0.0/12
            network 10.0.0.0/8
        }network-group SPAMHAUS_DROP {
        }    }
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    modify WAN_WLB {
        rule 5 {
            action modify
            destination {
                port 443
            }
            modify {
                lb-group HTTPS
            }
            protocol tcp
        }
        rule 10 {
            action modify
            description "do NOT load balance LAN to LAN"
            destination {
                group {
                    network-group LAN_NETS
                }
            }
            modify {
                table main
            }
        }
        rule 20 {
            action modify
            description "do NOT load balance destination public address - fixes Port Forwarding"
            destination {
                group {
                    address-group ADDRv4_eth6
                }
            }
            modify {
                table main
            }
        }
        rule 30 {
            action modify
            modify {
                lb-group G
            }
        }
    }
    name WAN_IN {
        default-action drop
        description "WAN to internal"rule 5 {
            action drop
            description "networks to drop from spamhaus.org list"
            source {
                group {
                    network-group SPAMHAUS_DROP
                }
            }
        }
        rule 10 {
            action accept
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            state {
                invalid enable
            }
        }
    }
    name WAN_LOCAL {
        default-action drop
        description "WAN to router"
        rule 10 {
            action accept
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            state {
                invalid enable
            }
        }
    }
    name eth3_IN {
        default-action accept
        description ""
        rule 1 {
            action accept
            description "Accept Established, Related"
            log disable
            protocol all
            state {
                established enable
                invalid disable
                new disable
                related enable
            }
        }
        rule 2 {
            action drop
            description "Drop local destinations"
            destination {
                group {
                    network-group Private_networks
                }
            }
            log disable
            protocol all
        }
    }
    name eth3_LOCAL {
        default-action drop
        description ""
        enable-default-log
        rule 1 {
            action accept
            description DNS
            destination {
                port 53
            }
            log disable
            protocol udp
        }
        rule 2 {
            action accept
            description DHCP
            destination {
                port 67
            }
            log disable
            protocol udp
        }
        rule 3 {
            action accept
            description Ping
            destination {
                group {
                    address-group ADDRv4_eth3
                }
            }
            log disable
            protocol icmp
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    ethernet eth0 {
        address 192.168.1.1/24
        description Local
        duplex auto
        firewall {
            in {
                modify WAN_WLB
            }
        }
        speed auto
    }
    ethernet eth1 {
        address 192.168.2.1/24
        description "CAT6 to 3bd/2ba"
        duplex auto
        firewall {
            in {
                modify WAN_WLB
            }
        }
        speed auto
    }
    ethernet eth2 {
        address 192.168.3.1/24
        description "CAT6 to 1bd/1ba"
        duplex auto
        firewall {
            in {
                modify WAN_WLB
            }
        }
        speed auto
    }
    ethernet eth3 {
        address 192.168.6.1/24
        description SunPower
        duplex auto
        firewall {
            in {
                name eth3_IN
            }
            local {
                name eth3_LOCAL
            }
        }
        speed auto
    }
    ethernet eth4 {
        address 192.168.4.1/24
        description "CAT6 to 2bd/1ba"
        duplex auto
        firewall {
            in {
                modify WAN_WLB
            }
        }
        speed auto
    }
    ethernet eth5 {
        description "CAT5e to 2bd/1ba"
        duplex auto
        speed auto
    }
    /* firewall */
    ethernet eth6 {
        address dhcp
        description "Internet from Monkey Brains"
        dhcp-options {
            default-route update
            default-route-distance 210
            name-server no-update
        }
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    ethernet eth7 {
        address dhcp
        description "Internet from xfinity / comcast"
        dhcp-options {
            default-route update
            default-route-distance 210
            name-server no-update
        }
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    loopback lo {
    }
}
load-balance {
    group G {
        interface eth6 {
            route-test {
                initial-delay 60
                interval 10
                type {
                    script /config/scripts/pinger
                }
            }
        }
        interface eth7 {
            route-test {
                initial-delay 60
                interval 10
                type {
                    script /config/scripts/pinger
                }
            }
        }
        lb-local enable
        sticky {
            dest-addr enable
            dest-port enable
            source-addr enable
        }
    }
    group HTTPS {
        interface eth6 {
            failover-only
            route-test {
                initial-delay 60
                interval 10
                type {
                    script /config/scripts/pinger
                }
            }
        }
        interface eth7 {
            route-test {
                initial-delay 60
                interval 10
                type {
                    script /config/scripts/pinger
                }
            }
        }
        lb-local enable
        sticky {
            dest-addr enable
            dest-port enable
            source-addr enable
        }
    }
}
port-forward {
    auto-firewall enable
    hairpin-nat disable
    rule 1 {
        description rtorrent
        forward-to {
            address 192.168.2.12
            port 6009
        }
        original-port 6009
        protocol tcp_udp
    }
    rule 2 {
        description rtorrent
        forward-to {
            address 192.168.2.12
            port 42000
        }
        original-port 42000
        protocol tcp_udp
    }
    wan-interface eth6
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name 1bdrm {
            authoritative disable
            subnet 192.168.3.0/24 {
                default-router 192.168.3.1
                dns-server 192.168.3.1
                lease 86400
                start 192.168.3.101 {
                    stop 192.168.3.240
                }
            }
        }
        shared-network-name 2bdrm {
            authoritative disable
            subnet 192.168.4.0/24 {
                default-router 192.168.4.1
                dns-server 192.168.4.1
                lease 86400
                start 192.168.4.101 {
                    stop 192.168.4.240
                }
            }
        }
        shared-network-name 3bdrm {
            authoritative disable
            subnet 192.168.2.0/24 {
                default-router 192.168.2.1
                dns-server 192.168.2.1
                lease 86400
                start 192.168.2.101 {
                    stop 192.168.2.240
                }
                static-mapping 192.168.2.6 {
                    ip-address 192.168.2.136
                    mac-address 44:61:32:c2:6f:bc
                }
                static-mapping 192.168.2.7 {
                    ip-address 192.168.2.138
                    mac-address 60:cb:fb:00:08:72
                }
                static-mapping Alexa_Amazon-Echo {
                    ip-address 192.168.2.19
                    mac-address 74:c2:46:e2:3d:80
                }
                static-mapping BIBZ {
                    ip-address 192.168.2.12
                    mac-address 00:08:9b:d3:03:f6
                }
                static-mapping EdgeSwitch {
                    ip-address 192.168.2.2
                    mac-address 44:d9:e7:05:25:a2
                }
                static-mapping FrontAC {
                    ip-address 192.168.2.3
                    mac-address 80:2a:a8:10:2d:62
                }
                static-mapping GE-Oven {
                    ip-address 192.168.2.18
                    mac-address d8:28:c9:01:92:39
                }
                static-mapping HDHomeRunTV_Tuner {
                    ip-address 192.168.2.17
                    mac-address 00:18:dd:03:d3:b3
                }
                static-mapping MFC-8670DN {
                    ip-address 192.168.2.5
                    mac-address 00:80:77:de:dc:ae
                }
                static-mapping NUC {
                    ip-address 192.168.2.13
                    mac-address ec:a8:6b:fe:30:4b
                }
                static-mapping RearAC {
                    ip-address 192.168.2.4
                    mac-address 80:2a:a8:10:2d:63
                }
                static-mapping UniFi-CloudKey {
                    ip-address 192.168.2.8
                    mac-address 44:d9:e7:9f:38:59
                }
            }
        }
        shared-network-name LAN1 {
            authoritative disable
            subnet 192.168.1.0/24 {
                default-router 192.168.1.1
                dns-server 192.168.1.1
                lease 86400
                start 192.168.1.101 {
                    stop 192.168.1.240
                }
            }
        }
        shared-network-name SunPower {
            authoritative disable
            subnet 192.168.6.0/24 {
                default-router 192.168.6.1
                dns-server 192.168.6.1
                lease 86400
                static-mapping SunPowerMonitoring {
                    ip-address 192.168.6.6
                    mac-address 80:2d:e1:1a:82:5c
                }
            }
        }
        use-dnsmasq disable
    }
    dns {
        dynamic {
            interface eth6 {
                service afraid {
                    host-name tiellium.mooo.com
                    login tiell
                    password ****************
                    server freedns.afraid.org
                }
            }
        }
        forwarding {
            cache-size 5000
            listen-on eth0
            listen-on eth1
            listen-on eth2
            listen-on eth3
            listen-on eth4
            listen-on eth5
        }
    }
    gui {
        http-port 80
        https-port 443
        older-ciphers enable
    }
    nat {
        rule 1 {
            description "ssh lan eth6"
            destination {
                port 222
            }
            inbound-interface eth6
            inside-address {
                address 192.168.2.1
                port 22
            }
            log disable
            protocol tcp
            type destination
        }
        rule 2 {
            description "ssh lan eth7"
            destination {
                port 222
            }
            inbound-interface eth7
            inside-address {
                address 192.168.2.1
                port 22
            }
            log disable
            protocol tcp
            type destination
        }
        rule 5010 {
            description "masquerade from all LANs to eth6 WAN"
            log disable
            outbound-interface eth6
            protocol all
            source {
                address 192.168.0.0/16
            }
            type masquerade
        }
        rule 5011 {
            description "masquerade from all LANs to eth7 WAN"
            log disable
            outbound-interface eth7
            protocol all
            source {
                address 192.168.0.0/16
            }
            type masquerade
        }
    }
    ssh {
        port 22
        protocol-version v2
    }
    upnp2 {
        listen-on eth1
        nat-pmp disable
        secure-mode disable
        wan eth6
    }
}
system {
    conntrack {
        expect-table-size 4096
        hash-size 4096
        table-size 32768
        tcp {
            half-open-connections 512
            loose enable
            max-retrans 3
        }
    }
    host-name ubnt-rtr
    login {
        user ****** {
            authentication {
                encrypted-password ****************
                plaintext-password ****************
            }
            level admin
        }
    }
    name-server 8.8.8.8
    name-server 8.8.4.4
    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
            }
        }
        host 192.168.2.12 {
            facility all {
                level info
            }
        }
    }
    time-zone America/Los_Angeles
    traffic-analysis {
        dpi enable
        export enable
    }
}

Viewing all articles
Browse latest Browse all 60861

Trending Articles