Here’s what I use as my routing engine protect firewall rules on my routers. 
This is the equivalent of the input chain firewall rules on mikrotik. I don’t 
filter much forward chain filtering. Warning: Juniper config ahead but you’ll 
hopefully get the idea. I have defined a bunch of rule’s that I’m not using at 
the moment. The loopback interface's inet6 input-list filter says what filters 
are currently enabled.

interfaces {
    lo0 {
        unit 0 {
            family inet6 {
                filter {
                    input-list [ discard-extension-headers 
accept-MLD-hop-by-hop_v6 deny-icmp6-undefined accept-common-services-v6 
accept-sh-bfd-v6 accept-bgp-v6 accept-ospf3 discard-all-v6 ];
                }
                address xxxx/128;
            }
        }
    }
}
firewall {
    family inet6 {
        filter discard-extension-headers {
            term discard-extension-headers {
                from {
                    /* Beware - VRRPv3 with authentication or OSPFv3 with 
Authentication enabled may use AH/ESP! */
                    next-header [ ah dstopts egp esp fragment gre icmp igmp 
ipip ipv6 no-next-header routing rsvp sctp ];
                }
                then {
                    count discard-ipv6-extension-headers;
                    log;
                    syslog;
                    discard;
                }
            }
        }
        filter deny-icmp6-undefined {
            apply-flags omit;
            term icmp6-unassigned-discard {
                from {
                    next-header icmpv6;
                    icmp-type [ 102-106 155-199 202-254 ];
                }
                then discard;
            }
            term rfc4443-discard {
                from {
                    next-header icmpv6;
                    icmp-type [ 100-101 200-201 ];
                }
                then discard;
            }
        }
        filter accept-icmp6-misc {
            apply-flags omit;
            term neigbor-discovery-accept {
                from {
                    next-header icmpv6;
                    icmp-type 133-136;
                }
                then accept;
            }
            term inverse-neigbor-discovery-accept {
                from {
                    next-header icmpv6;
                    icmp-type 141-142;
                }
                then accept;
            }
            term icmp6-echo-request {
                from {
                    next-header icmpv6;
                    icmp-type echo-request;
                }
                then accept;
            }
            term icmp6-echo-reply {
                from {
                    next-header icmpv6;
                    icmp-type echo-reply;
                }
                then accept;
            }
            term icmp6-dest-unreachable-accept {
                from {
                    next-header icmpv6;
                    icmp-type destination-unreachable;
                }
                then accept;
            }
            term icmp6-packet-too-big-accept {
                from {
                    next-header icmpv6;
                    icmp-type packet-too-big;
                }
                then accept;
            }
            term icmp6-time-exceeded-accept {
                from {
                    next-header icmpv6;
                    icmp-type time-exceeded;
                    icmp-code 0;
                }
                then accept;
            }
            term icmp6-parameter-problem-accept {
                from {
                    next-header icmpv6;
                    icmp-type parameter-problem;
                    icmp-code [ 1 2 ];
                }
                then accept;
            }
        }
        filter accept-sh-bfd-v6 {
            apply-flags omit;
            term accept-sh-bfd-v6 {
                from {
                    source-prefix-list {
                        router-ipv6;
                    }
                    destination-prefix-list {
                        router-ipv6;
                    }
                    source-port 49152-65535;
                    destination-port 3784-3785;
                }
                then accept;
            }
        }
        filter accept-MLD-hop-by-hop_v6 {
            apply-flags omit;
            term bgp_v6 {
                from {
                    next-header hop-by-hop;
                }
                then {
                    count hop-by-hop-extension-packets;
                    accept;
                }
            }
        }
        filter accept-bgp-v6 {
            apply-flags omit;
            term bgp_v6 {
                from {
                    prefix-list {
                        bgp-neighbors_v6;
                    }
                    next-header tcp;
                    destination-port bgp;
                }
                then accept;
            }
        }
        filter accept-ospf3 {
            apply-flags omit;
            term ospfv3 {
                from {
                    source-prefix-list {
                        link_local;
                    }
                    next-header ospf;
                }
                then accept;
            }
        }
        filter accept-dns-v6 {
            apply-flags omit;
            term dnsv6 {
                from {
                    source-prefix-list {
                        rfc3849;
                    }
                    next-header [ udp tcp ];
                    port domain;
                }
                then accept;
            }
        }
        filter accept-ntp-v6 {
            apply-flags omit;
            term ntpv6 {
                from {
                    source-prefix-list {
                        rfc3849;
                    }
                    next-header udp;
                    destination-port ntp;
                }
                then accept;
            }
        }
        filter accept-ssh-v6 {
            apply-flags omit;
            term sshv6 {
                from {
                    source-prefix-list {
                        rfc3849;
                    }
                    next-header tcp;
                    destination-port ssh;
                }
                then {
                    policer management-5m;
                    count accept-ssh;
                    accept;
                }
            }
        }
        filter accept-snmp-v6 {
            apply-flags omit;
            term snmpv6 {
                from {
                    source-prefix-list {
                        rfc3849;
                    }
                    next-header udp;
                    destination-port snmp;
                }
                then accept;
            }
        }
        filter accept-radius-v6 {
            apply-flags omit;
            term radiusv6 {
                from {
                    source-prefix-list {
                        rfc3849;
                    }
                    next-header udp;
                    port [ 1812 1813 ];
                }
                then accept;
            }
        }
        filter accept-common-services-v6 {
            apply-flags omit;
            term accept-icmp6 {
                filter accept-icmp6-misc;
            }
            term accept-traceroute-v6 {
                filter accept-traceroute-v6;
            }
            term accept-ssh-v6 {
                filter accept-ssh-v6;
            }
            term accept-snmp-v6 {
                filter accept-snmp-v6;
            }
            term accept-ntp-v6 {
                filter accept-ntp-v6;
            }
            term accept-dns-v6 {
                filter accept-dns-v6;
            }
        }
        filter accept-traceroute-v6 {
            apply-flags omit;
            term accept-traceroute-udp {
                from {
                    destination-prefix-list {
                        router-ipv6;
                    }
                    next-header udp;
                    destination-port 33435-33450;
                }
                then {
                    policer management-1m;
                    count accept-traceroute-udp-v6;
                    accept;
                }
            }
            term accept-traceroute-icmp6 {
                from {
                    destination-prefix-list {
                        router-ipv6;
                    }
                    next-header icmp;
                    icmp-type [ echo-request time-exceeded ];
                }
                then {
                    policer management-1m;
                    count accept-traceroute-icmp6;
                    accept;
                }
            }
            term accept-traceroute-tcp-v6 {
                from {
                    destination-prefix-list {
                        router-ipv6;
                    }
                    next-header tcp;
                }
                then {
                    policer management-1m;
                    count accept-traceroute-tcp-v6;
                    accept;
                }
            }
        }
        filter discard-all-v6 {
            apply-flags omit;
            term discard-tcp-v6 {
                from {
                    next-header tcp;
                }
                then {
                    count discard-tcp-v6;
                    log;
                    syslog;
                    discard;
                }
            }
            term discard-netbios-v6 {
                from {
                    next-header udp;
                    destination-port 137;
                }
                then {
                    count discard-netbios-v6;
                    log;
                    syslog;
                    discard;
                }
            }
            term discard-udp {
                from {
                    next-header udp;
                }
                then {
                    count discard-udp-v6;
                    log;
                    syslog;
                    discard;
                }
            }
            term discard-icmp6 {
                from {
                    next-header icmp;
                }
                then {
                    count discard-icmp;
                    log;
                    syslog;
                    discard;
                }
            }
            term discard-unknown {
                then {
                    count discard-unknown;
                    log;
                    syslog;
                    discard;
                }
            }
        }
    }
}
-- 
Timothy Nowaczyk  |  Senior Network Manager
office  703.554.6622 <tel:703.554.6622>  |  mobile  571.318.9434 
<tel:571.318.9434> 

 <http://www.allpointsbroadband.com/>
> On Jul 11, 2016, at 11:52 AM, Brent Smith <[email protected]> wrote:
> 
> What is common practice for firewalling with IPv6?
> 
> -- 
> Brent Smith
> Network Technician
> New Lisbon Broadband and Communications
> www.nlbc.com
> (765)332-2887
> MTCNA MTCWE
> --
> 
> 
> _______________________________________________
> Ipv6 mailing list
> [email protected]
> http://lists.wispa.org/mailman/listinfo/ipv6

_______________________________________________
Mikrotik-users mailing list
[email protected]
http://lists.wispa.org/mailman/listinfo/mikrotik-users

Reply via email to