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

Re: Local lan to ipsec remote hosts

$
0
0
firewall {
    all-ping enable
    broadcast-ping disable
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    name GUEST_IN {
        default-action accept
        description ""
        rule 1 {
            action drop
            description "block guest VLAN access to LAN resources"
            destination {
                address 192.168.1.0/24
            }
            log disable
            protocol all
        }
        rule 2 {
            action drop
            description "block guest VLAN access to voice vlan resources"
            destination {
                address 192.168.3.0/24
            }
            log disable
            protocol all
        }
    }
    name GUEST_LOCAL {
        default-action accept
        description "Allow guest access to query router DNS"
        rule 1 {
            action accept
            description DNS
            destination {
                port 53
            }
            log disable
            protocol udp
        }
    }
    name WAN_IN {
        default-action drop
        description "WAN to internal"
        rule 10 {
            action accept
            description "Allow established/related"
            log disable
            protocol all
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"
            log disable
            state {
                invalid enable
            }
        }
    }
    name WAN_LOCAL {
        default-action drop
        description "WAN to router"
        rule 10 {
            action accept
            description "allow established session to the router"
            log disable
            protocol all
            state {
                established enable
                invalid disable
                new disable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"
            log disable
            protocol all
            state {
                invalid enable
            }
        }
    }
    options {
        mss-clamp {
            interface-type pppoe
            interface-type pptp
            interface-type tun
            mss 1412
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    ethernet eth0 {
        address dhcp
        description "WAN (orange fibre)"
        duplex auto
        speed auto
        vif 835 {
            pppoe 0 {
                default-route auto
                firewall {
                    in {
                        name WAN_IN
                    }
                    local {
                        name WAN_LOCAL
                    }
                }
                mtu 1492
                name-server auto
                password xxx
                user-id xxx
            }
        }
    }
    ethernet eth1 {
        address dhcp
        description "WAN 2 (free adsl)"
        duplex auto
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        speed auto
    }
    ethernet eth2 {
        address 192.168.1.1/24
        description "Local Network"
        duplex auto
        mtu 1492
        speed auto
        vif 100 {
            address 192.168.3.1/24
            description VLAN-voip
            mtu 1492
        }
        vif 1003 {
            address 192.168.4.1/24
            description VLAN-guest
            firewall {
                in {
                    name GUEST_IN
                }
                local {
                    name GUEST_LOCAL
                }
            }
            mtu 1492
        }
    }
    loopback lo {
    }
}
load-balance {
    group G {
        interface eth1 {
            failover-only
        }
        interface pppoe0 {
        }
    }
}
protocols {
}
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.6
                dns-server 192.168.1.1
                lease 86400
                start 192.168.1.50 {
                    stop 192.168.1.249
                }
            }
        }
        shared-network-name LAN-guest {
            authoritative disable
            subnet 192.168.4.0/24 {
                default-router 192.168.4.1
                dns-server 8.8.8.8
                dns-server 8.8.4.4
                lease 86400
                start 192.168.4.50 {
                    stop 192.168.4.199
                }
            }
        }
        shared-network-name LAN-voip {
            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.50 {
                    stop 192.168.3.249
                }
            }
        }
    }
    dns {
        forwarding {
            cache-size 1000
            listen-on eth2.100
            listen-on eth2
            listen-on eth2.1003
        }
    }
    gui {
        http-port 80
        https-port 443
        older-ciphers disable
    }
    nat {
        rule 5001 {
            description "exclude ipsec"
            destination {
                address 10.129.133.0/26
            }
            exclude
            log enable
            outbound-interface pppoe0
            protocol all
            source {
                address 192.168.1.0/24
            }
            type masquerade
        }
        rule 5010 {
            description "masquerade for WAN pppoe"
            outbound-interface pppoe0
            type masquerade
        }
        rule 5020 {
            description "masquerade for WAN eth1"
            outbound-interface eth1
            type masquerade
        }
    }
    ssh {
        listen-address 192.168.1.1
        port 22
        protocol-version v2
    }
}
system {
    host-name xxx
    login {
        user ubnt {
            authentication {
                encrypted-password xxx
            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 {
        }
    }
    offload {
        hwnat disable
        ipsec enable
        ipv4 {
            forwarding enable
            pppoe enable
            vlan enable
        }
    }
    syslog {
        global {
            facility all {
                level notice
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone Europe/Paris
}
vpn {
    ipsec {
        auto-firewall-nat-exclude enable
        esp-group FOO0 {
            compression disable
            lifetime 3600
            mode tunnel
            pfs enable
            proposal 1 {
                encryption 3des
                hash sha1
            }
        }
        ike-group FOO0 {
            ikev2-reauth no
            key-exchange ikev1
            lifetime 28800
            proposal 1 {
                dh-group 2
                encryption aes256
                hash sha1
            }
        }
        ipsec-interfaces {
            interface pppoe0
        }
        nat-traversal disable
        site-to-site {
            peer x.x.x.x {
                authentication {
                    mode pre-shared-secret
                    pre-shared-secret xxxxx
                }
                connection-type initiate
                description "VPN xxx"
                ike-group FOO0
                ikev2-reauth inherit
                local-address any
                tunnel 1 {
                    allow-nat-networks disable
                    allow-public-networks disable
                    esp-group FOO0
                    local {
                        prefix 192.168.1.0/24
                    }
                    remote {
                        prefix 10.129.133.0/26
                    }
                }
            }
        }
    }
}


/* 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.5.4884695.160608.1057 */

From the log, I don't see the masquerade exlusion on pppoe interface applhying to any packet

 

Capture d’écran 2016-08-04 à 09.31.24.png

 


Viewing all articles
Browse latest Browse all 60861

Trending Articles