IPSec IKEv2 roadwarrior IPv6 rules

Hello,

I have an IPSec IKEv2 roadwarrior tunnel configured on my VyOS 1.4 which optionally supports WAN IPv6 from connected clients, it works fine. On the other hand, I notice that from the outside my clients connected with an IPv6 from the pool assigned to remore-access are accessible from the outside and impossible to filter the packets with their IP as destinations. I don’t understand, where do the filters apply to prevent communications to these clients?

Thanks for your help and here’s the configuration I use for my VPN Roadwarrior by modifying the values :

#########################
## IPSec | ROADWARRIOR ##
#########################

#
## IPSec global config
#######################

set vpn ipsec interface 'eth0'
set vpn ipsec options 'disable-route-autoinstall'

#
## Config
##########

# Phase 1
set vpn ipsec ike-group IKE-ROADWARRIOR key-exchange 'ikev2'
set vpn ipsec ike-group IKE-ROADWARRIOR lifetime '7200'
set vpn ipsec ike-group IKE-ROADWARRIOR proposal 10 encryption 'aes256gcm128'
set vpn ipsec ike-group IKE-ROADWARRIOR proposal 10 hash 'sha384'
set vpn ipsec ike-group IKE-ROADWARRIOR proposal 10 dh-group '24'

# Phase 2
set vpn ipsec esp-group ESP-ROADWARRIOR lifetime '3600'
set vpn ipsec esp-group ESP-ROADWARRIOR proposal 10 encryption 'aes256gcm128'
set vpn ipsec esp-group ESP-ROADWARRIOR proposal 10 hash 'sha256'
set vpn ipsec esp-group ESP-ROADWARRIOR pfs 'dh-group24'

# Remote Access
set vpn ipsec remote-access pool ROADWARRIOR-IPV4 prefix '10.10.50.0/24'
set vpn ipsec remote-access pool ROADWARRIOR-IPV4 name-server '10.10.40.200'
set vpn ipsec remote-access pool ROADWARRIOR-IPV6 prefix 'w:x:y:z::/64'

set vpn ipsec remote-access connection ROADWARRIOR esp-group 'ESP-ROADWARRIOR'
set vpn ipsec remote-access connection ROADWARRIOR ike-group 'IKE-ROADWARRIOR'
set vpn ipsec remote-access connection ROADWARRIOR pool 'ROADWARRIOR-IPV4'
set vpn ipsec remote-access connection ROADWARRIOR pool 'ROADWARRIOR-IPV6'
set vpn ipsec remote-access connection ROADWARRIOR authentication local-id 'my.roadwarrior.host'
set vpn ipsec remote-access connection ROADWARRIOR authentication client-mode 'eap-mschapv2'
set vpn ipsec remote-access connection ROADWARRIOR authentication x509 certificate 'IPSec_my.roadwarrior.host'
set vpn ipsec remote-access connection ROADWARRIOR authentication x509 ca-certificate 'CA_VyOS_my.roadwarrior.host'

# PSK EAP
set vpn ipsec remote-access connection ROADWARRIOR authentication local-users username mysuperuser password 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

#
## Firewall
############

########## WAN ##########

## WAN-GUESTS

set firewall name WAN-GUESTS rule 2000 action 'accept'
set firewall name WAN-GUESTS rule 2000 ipsec match-ipsec
set firewall name WAN-GUESTS rule 2000 source address '10.10.50.0/24'

## WAN-LAN

set firewall name WAN-LAN rule 2000 action 'accept'
set firewall name WAN-LAN rule 2000 ipsec match-ipsec
set firewall name WAN-LAN rule 2000 source address '10.10.50.0/24'

## WAN-LOCAL

set firewall name WAN-LOCAL rule 2000 action 'accept'
set firewall name WAN-LOCAL rule 2000 ipsec match-ipsec
set firewall name WAN-LOCAL rule 2000 source address '10.10.50.0/24'

#
## NAT Outbound
################

# SNAT RoadWarrior v4 (Outbound)
set nat source rule 110 outbound-interface 'eth0'
set nat source rule 110 source address '10.10.50.0/24'
set nat source rule 110 translation address 'masquerade'

I use zones:

  • eth0 => WAN
  • eth1 => LAN
  • eth2 => GUESTS

All IPSec traffic is considered on the eth0 interface and therefore the WAN zone.
So when traffic arrives from outside, it’s considered as WAN traffic and would come out on … WAN.

I thank you for your help on this point.

Since traffic is in the same zone (WAN) you will need to apply a firewall to the interface as well. I took some of your roadwarrior settings and flipped things here and there.

Firewall on eth0 with default accept since zone based rules are also in play

 interface eth0 {
     in {
         ipv6-name BLOCKEM
     }
     local {
     }
     out {
     }
 }
 ipv6-name BLOCKEM {
     default-action accept
     description "Block some things"
     rule 10 {
         action reject
         destination {
             address 2603:3001:38e4:c1ff:dead:beef::/96
         }
         protocol ipv6-icmp
     }
 }
various config sections
vpn {
    ipsec {
        esp-group ESP-ROADWARRIOR {
            lifetime 3600
            pfs dh-group14
            proposal 1 {
                encryption aes256
                hash sha256
            }
        }
        ike-group IKE-ROADWARRIOR {
            key-exchange ikev2
            lifetime 7200
            proposal 1 {
                dh-group 14
                encryption aes256
                hash sha256
                prf prfsha256
            }
        }
        interface eth0
        interface dum10 *** My public facing VPN endpoint IP listens here ****
        options {
            disable-route-autoinstall
        }
        remote-access {
            connection ROADWARRIOR {
                authentication {
                    local-id vpn.atlmesh.net
                    local-users {
                        username deeznutz {
                            password ****************
                        }
                    }
                    server-mode x509
                    x509 {
                        ca-certificate LetsEncrypt
                        certificate vpn.atlmesh.net
                    }
                }
                esp-group ESP-ROADWARRIOR
                ike-group IKE-ROADWARRIOR
                pool ROADWARRIOR-IPV6
            }
            pool ROADWARRIOR-IPV6 {
                prefix 2603:3001:38e4:c1ff:dead:beef::/96
            }
        }

RESULTS: Pinged my iphone from another nearby wireless network

vyos@vyos:~$ tcpdump -i eth0 icmp6
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
19:59:46.355823 IP6 2601:c2:4:3942:ad9b:afea:c9df:38ab > 2603:3001:38e4:c1ff:dead:beef:0:1: ICMP6, echo request, id 12454, seq 160, length 16
19:59:46.355958 IP6 2001:558:6011:21:b456:fe1e:f729:2274 > 2601:c2:4:3942:ad9b:afea:c9df:38ab: ICMP6, destination unreachable, unreachable port [|icmp6]
19:59:47.361376 IP6 2601:c2:4:3942:ad9b:afea:c9df:38ab > 2603:3001:38e4:c1ff:dead:beef:0:1: ICMP6, echo request, id 12454, seq 161, length 16
19:59:47.361437 IP6 2001:558:6011:21:b456:fe1e:f729:2274 > 2601:c2:4:3942:ad9b:afea:c9df:38ab: ICMP6, destination unreachable, unreachable port [|icmp6]
19:59:47.496732 IP6 fe80::201:5cff:fe7e:fe46 > ip6-allnodes: ICMP6, router advertisement, length 144
19:59:48.363361 IP6 2601:c2:4:3942:ad9b:afea:c9df:38ab > 2603:3001:38e4:c1ff:dead:beef:0:1: ICMP6, echo request, id 12454, seq 162, length 16
19:59:48.363447 IP6 2001:558:6011:21:b456:fe1e:f729:2274 > 2601:c2:4:3942:ad9b:afea:c9df:38ab: ICMP6, destination unreachable, unreachable port [|icmp6]
2 Likes

I didn’t know that I could define “classic” firewalls on interfaces in addition to my zones.

So if I’ve understood correctly, as long as my interface is in a default drop zone, I can safely define default accept firewalls on my interface, as this will then be filtered on the zone.

So I added this, and the result seems to be exactly what I was looking for :

########## ETH0 ##########

## IN-V6

# Default accept ETH0-IN-V6 (because zones filters after)
set firewall ipv6-name SECURE_ROADWARRIOR_V6 default-action 'accept'

# Drop outside to Roadwarrior V6 pool except icmpv6
set firewall ipv6-name SECURE_ROADWARRIOR_V6 rule 10 action 'drop'
set firewall ipv6-name SECURE_ROADWARRIOR_V6 rule 10 protocol '!icmpv6'
set firewall ipv6-name SECURE_ROADWARRIOR_V6 rule 10 destination address 'w:x:y:z::/64'
set firewall ipv6-name SECURE_ROADWARRIOR_V6 rule 10 log 'enable'
set firewall ipv6-name SECURE_ROADWARRIOR_V6 rule 10 description 'Drop outside to Roadwarrior V6 pool'

# Link SECURE_ROADWARRIOR_V6 firewall to eth0 (WAN)
set firewall interface eth0 in ipv6-name SECURE_ROADWARRIOR_V6

I’m thinking of using this method to also filter IPSec traffic from my other site-to-site IPSec tunnels.

Thank you very much for taking the time to help me :wink:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.