firewall {
    all-ping enable
    broadcast-ping disable
    ipv6-name WAN6_IN {
        default-action drop
        description "packets from internet to LAN & WLAN"
    }
    ipv6-name WAN6_LOCAL {
        default-action drop
        description "packets from internet to the router"
    }
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    name WAN_IN {
        default-action drop
        description "packets from internet to LAN & WLAN"
        rule 5 {
            action accept
            description "Allow Multicast"
            destination {
                address 224.0.0.0/4
            }
        }
        rule 10 {
            action accept
            description "allow established sessions"
            protocol all
            state {
                established enable
                invalid disable
                new disable
                related enable
            }
        }
        rule 15 {
            action accept
            description "Allow 1287/1288 for STB"
            destination {
                port 1287-1288
            }
            protocol tcp
            state {
                new enable
            }
        }
        rule 20 {
            action accept
            description "Allow UDP to Multicast"
            destination {
                address 224.0.0.0/4
            }
            protocol udp
            state {
                new enable
            }
        }
        rule 25 {
            action accept
            description "Allow ICMP"
            protocol icmp
            state {
                established enable
                related enable
            }
        }
        rule 30 {
            action accept
            description "Allow IGMP"
            protocol igmp
        }

    }
    name WAN_LOCAL {
        default-action drop
        description test
        rule 1 {
            action accept
            description "Allow Multicast"
            destination {
                address 224.0.0.0/4
            }
        }
        rule 2 {
            action accept
            description "allow established sessions"
            protocol all
            state {
                established enable
                invalid disable
                new disable
                related enable
            }
        }
        
        rule 5 {
            action drop
            description "drop invalid state"
            log disable
            protocol all
            state {
                established disable
                invalid enable
                new disable
                related disable
            }
        }
    }
    name WAN_OUT {
        default-action accept
        description "filtrage du sortant"
    }
    options {
        mss-clamp {
            mss 1452
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    bridge br0 {
        aging 300
        bridged-conntrack disable
        hello-time 2
        max-age 20
        priority 32768
        promiscuous disable
        stp true
    }
    ethernet eth0 {
        address 192.168.1.1/24
        description LAN
        duplex auto
        speed auto
    }
    ethernet eth1 {
        address dhcp
        description WAN
        dhcp-options {
            default-route update
            default-route-distance 210
            name-server update
        }
        duplex auto
        firewall {
            in {
            }
            local {
            }
            out {
            }
        }
        speed auto
        vif 10 {
            bridge-group {
                bridge br0
            }
            description administration
        }
        vif 100 {
            bridge-group {
                bridge br0
            }
            description TV
        }
        vif 200 {
            address dhcp
            description Internet
            dhcp-options {
                client-option "send vendor-class-identifier &quot;byteliad_data&quot;;"
                default-route update
                default-route-distance 210
                name-server update
            }
            firewall {
                in {
                    name WAN_IN
                }
                local {
                    name WAN_LOCAL
                }
                out {
                    name WAN_OUT
                }
            }
        }
    }
    ethernet eth2 {
        address 192.168.20.1/24
        description Bbox
        duplex auto
        speed auto
        vif 10 {
            bridge-group {
                bridge br0
            }
            description administration
        }
        vif 100 {
            bridge-group {
                bridge br0
            }
            description TV
        }
        vif 200 {
            address 10.10.2.1/24
            description Internet-Bbox
        }
    }
    loopback lo {
    }
    
}
port-forward {
    auto-firewall enable
    hairpin-nat enable
    lan-interface eth0
    wan-interface eth1.200
}
protocols {
    igmp-proxy {
        interface eth1 {
            alt-subnet 0.0.0.0/0
            role upstream
            threshold 1
        }
        interface eth2 {
            alt-subnet 0.0.0.0/0
            role downstream
            threshold 1
        }
    }
    static {
                    }
        }
    }
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name bootpxe {
            authoritative disable
            subnet 192.168.100.0/24 {
                bootfile-name pxelinux.0
                bootfile-server 192.168.100.254
                default-router 192.168.100.1
                dns-server 8.8.8.8
                lease 86400
                start 192.168.100.10 {
                    stop 192.168.100.100
                }
                
            }
        }
        shared-network-name lan {
            authoritative disable
            subnet 192.168.1.0/24 {
                default-router 192.168.1.1
                dns-server 192.168.1.1
                lease 7200
                ntp-server 192.168.1.1
                start 192.168.1.2 {
                    stop 192.168.1.100
                }
                
            }
        }
        shared-network-name net-bbox {
            authoritative disable
            subnet 10.10.2.0/24 {
                default-router 10.10.2.1
                dns-server 10.10.2.1
                dns-server 8.8.8.8
                lease 86400
                start 10.10.2.2 {
                    stop 10.10.2.5
                }
                
            }
        }
    }
    dns {
        forwarding {
            cache-size 150
            listen-on eth1
            listen-on eth0
            listen-on eth2
        }
    }
    gui {
        https-port 443
    }
    nat {
        
        rule 5001 {
            description "masquerade eth1.200"
            log disable
            outbound-interface eth1.200
            type masquerade
        }
    }
    snmp {
        community public {
            authorization ro
        }
    }
    ssh {
        port 22
        protocol-version v2
    }
    ubnt-discover {
        disable
    }
}
system {
    host-name ubnt
    login {
        user toto {
            authentication {
                encrypted-password totowxwwwww
                plaintext-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 {
        }
    }
    offload {
        ipv4 {
            vlan enable
        }
    }
    static-host-mapping {
        
    }
    syslog {
        global {
            facility all {
                level notice
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone Europe/Paris
}
vpn {
    ipsec {
        auto-firewall-nat-exclude disable
        ipsec-interfaces {
            interface eth1.200
        }
        nat-networks {
            allowed-network 0.0.0.0/0 {
            }
        }
        nat-traversal enable
    }
    l2tp {
        remote-access {
            authentication {
                local-users {
                    username toto {
                        password "totopws"
                    }
                }
                mode local
            }
            client-ip-pool {
                start 192.168.99.6
                stop 192.168.99.8
            }
            dns-servers {
                server-1 192.168.1.1
                server-2 8.8.8.8
            }
            ipsec-settings {
                authentication {
                    mode pre-shared-secret
                    pre-shared-secret toto
                }
                ike-lifetime 3600
            }
            outside-address 176.158.0.58
            outside-nexthop 192.168.1.1
        }
    }
}


/* 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@4: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.7.0alpha3.4760682.150404.2033 */
