## Last changed: 2019-06-27 08:22:27 GMT+8
version 15.1X49-D70.3;
system {
    host-name SRX;
    time-zone GMT+8;
    root-authentication {
        encrypted-password "$5$xHshT0Cq$TRhlN6G/pjn9VwNJpCI1OW/1wJjWN4AIm6JBYu/dP05";
    }
    name-server {
        8.8.8.8;
        8.8.4.4;
    }
    name-resolution {
        no-resolve-on-input;
    }
    login {
        user admin {
            uid 2002;
            class super-user;
            authentication {
                encrypted-password "$5$QVybwM2x$LxJ7ALAXpeD8jgG/pyBbxe/vqTk3mp2TE9dIfAltY71";
            }
        }
    }
    services {
        dhcp-local-server {
            group dhcp-default-group {
                interface irb.0;
            }
        }
        web-management {
            http;
            https {
                system-generated-certificate;
            }
            session {
                idle-timeout 300;
            }
        }
    }
    syslog {
        archive size 100k files 3;
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
    max-configurations-on-flash 5;
    max-configuration-rollbacks 5;
    license {
        autoupdate {
            url https://ae1.juniper.net/junos/key_retrieval;
        }
    }
    ntp {
        server us.ntp.pool.org;
    }
}
security {
    ike {
        proposal PROPOSAL-1 {
            authentication-method pre-shared-keys;
            dh-group group2;
            authentication-algorithm sha1;
            encryption-algorithm 3des-cbc;
            lifetime-seconds 28800;
        }
        policy ike_pol_IKE-SRX {
            mode aggressive;
            proposals PROPOSAL-1;
            pre-shared-key ascii-text "$9$DliHm5T39CuJGn/AtOB7-dVgo";
        }
        gateway gw_IKE-SRX {
            ike-policy ike_pol_IKE-SRX;
            address x.x.x.x;
            local-identity hostname abc.ddns.net;
            external-interface ge-0/0/0.0;
        }
    }
    ipsec {
        proposal PROPOSAL-2 {
            protocol esp;
            authentication-algorithm hmac-md5-96;
            encryption-algorithm 3des-cbc;
            lifetime-seconds 3600;
        }
        policy ipsec_pol_IKE-SRX {
            perfect-forward-secrecy {
                keys group2;
            }
            proposals PROPOSAL-2;
        }
        vpn IKE-SRX {
            bind-interface st0.1;
            vpn-monitor {
                optimized;
            }
            ike {
                gateway gw_IKE-SRX;
                ipsec-policy ipsec_pol_IKE-SRX;
            }
            establish-tunnels immediately;
        }
    }
    screen {
        ids-option untrust-screen {
            icmp {
                ping-death;
            }
            ip {
                source-route-option;
                tear-drop;
            }
            tcp {
                syn-flood {
                    alarm-threshold 1024;
                    attack-threshold 200;
                    source-threshold 1024;
                    destination-threshold 2048;
                    timeout 20;
                }
                land;
            }
        }
    }
    nat {
        source {
            rule-set nsw_srcnat {
                from zone Internal;
                to zone Internet;
                rule nsw-src-interface {
                    match {
                        source-address 192.168.0.0/24;
                        destination-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;
                        }
                    }
                }
                rule no_nat {
                    match {
                        source-address 192.168.5.0/24;
                        destination-address 192.168.21.0/24;
                    }
                    then {
                        source-nat {
                            off;
                        }
                    }
                }
            }
        }
    }
    policies {
        from-zone Internal to-zone Internet {
            policy All_Internal_Internet {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
            policy policy_out_IKE-SRX {
                match {
                    source-address addr_192_168_5_0_24;
                    destination-address addr_192_168_21_0_24;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone Internet to-zone Internal {
            policy policy_in_IKE-SRX {
                match {
                    source-address adde_192_168_21_0_24;
                    destination-address addr_192_168_5_0_24;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone Internal to-zone VPN {
            policy TR-VPN {
                match {
                    source-address addr_192_168_5_0_24;
                    destination-address Remote;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone VPN to-zone Internal {
            policy VPN-TR {
                match {
                    source-address Remote;
                    destination-address addr_192_168_5_0_24;
                    application any;
                }
                then {
                    permit;
                    log {
                        session-init;
                        session-close;
                    }
                }
            }
        }
    }
    zones {
        security-zone Internal {
            address-book {
                address addr_192_168_5_0_24 192.168.5.0/24;
            }
            host-inbound-traffic {
                system-services {
                    all;
                }
            }
            interfaces {
                irb.0 {
                    host-inbound-traffic {
                        system-services {
                            ping;
                            dhcp;
                        }
                    }
                }
            }
        }
        security-zone Internet {
            address-book {
                address addr_192_168_21_0_24 192.168.21.0/24;
            }
            host-inbound-traffic {
                system-services {
                    ike;
                    http;
                    https;
                    ping;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                ge-0/0/0.0 {
                    host-inbound-traffic {
                        system-services {
                            ping;
                            dhcp;
                            http;
                            https;
                            ike;
                        }
                        protocols {
                            all;
                        }
                    }
                }
            }
        }
        security-zone VPN {
            address-book {
                address Remote 192.168.21.0/24;
            }
            host-inbound-traffic {
                system-services {
                    ike;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                st0.1 {
                    host-inbound-traffic {
                        system-services {
                            ike;
                        }
                        protocols {
                            all;
                        }
                    }
                }
            }
        }
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 192.168.0.132/24;
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    ge-0/0/2 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    ge-0/0/3 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    ge-0/0/4 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    ge-0/0/5 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    ge-0/0/6 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    ge-0/0/7 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan0;
                }
            }
        }
    }
    irb {
        unit 0 {
            family inet {
                address 192.168.5.1/24;
            }
        }
    }
    st0 {
        unit 1 {
            family inet;
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 next-hop 192.168.0.1;
        route 192.168.21.0/24 next-hop st0.1;
    }
}
protocols {
    l2-learning {
        global-mode switching;
    }
}
access {
    address-assignment {
        pool dhcp-default-pool {
            family inet {
                network 192.168.5.0/24;
                range dhcp-default-range {
                    low 192.168.5.10;
                    high 192.168.5.200;
                }
                dhcp-attributes {
                    name-server {
                        8.8.8.8;
                        8.8.4.4;
                    }
                    router {
                        192.168.5.1;
                    }
                }
            }
        }
    }
}
vlans {
    vlan0 {
        vlan-id 2;
        l3-interface irb.0;
    }
}