IPSec VPN - once working, now doesn't any more

Hi guys,

I have a problem that I cannot solve myself. Here is the story:

My home lab has an IPSec VPN configured via “OpenWRT”. I am using this VPN for Windows, Android and Linux devices. It works great in all places, and also used to work in Qubes. But since some time (I cannot tell since when, as I didn’t use it from within Qubes since months) in Qubes it is not working any more.

The situation is as follows:

  • VPN correctly connects (visible in the status bar on the icon)
  • internal network can be reached from within VPN qube (ping internal IPs, resolve internal hostnames, resolve external hostnames based on internal DNS)
  • any other qube, using the VPN qube as network qube, has no network access (neither internal, nor external)

I have tried a lot of things like messing with routes, checking configurations, checking nft entries… I have not found the actual reason. Wondering why it worked before, and doesn’t work now. I have not changed any setting, so I guess it is related to an update.

Here are the information I can provide, that I also checked myself. Maybe somebody sees an issue here.

“sudo ip route show”:

default via 10.138.13.22 dev eth0 proto static metric 100
10.137.0.16 dev vif32.0 scope link metric 32720
10.138.13.22 dev eth0 proto static scope link metric 50
93.192.82.43 via 10.138.13.22 dev eth0 proto static metric 50

“sudo ip addr show”:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 192.168.20.182/32 scope global lo
valid_lft forever preferred_lft forever
inet6 fd80:db8:1:20::180/128 scope global nodad
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group 1 qlen 1000
link/ether 00:16:3e:5e:6c:00 brd ff:ff:ff:ff:ff:ff
inet 10.137.0.19/32 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::216:3eff:fe5e:6c00/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
3: vif32.0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group 2 qlen 1000
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
inet 10.137.0.19/32 scope global vif32.0
valid_lft forever preferred_lft forever
inet6 fe80::fcff:ffff:feff:ffff/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
5: nm-xfrm-7772609@NONE: <NOARP,UP,LOWER_UP> mtu 1400 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet 192.168.20.182/32 scope global noprefixroute nm-xfrm-7772609
valid_lft forever preferred_lft forever
inet6 fd80:db8:1:20::180/128 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::d8fc:c45e:1ac9:1297/64 scope link stable-privacy proto kernel_ll
valid_lft forever preferred_lft forever

“sudo nft list ruleset”:

table ip qubes {
	set downstream {
		type ipv4_addr
		elements = { 10.137.0.16 }
	}

	set allowed {
		type ifname . ipv4_addr
		elements = { "vif32.0" . 10.137.0.16 }
	}

	chain prerouting {
		type filter hook prerouting priority raw; policy accept;
		iifgroup 2 goto antispoof
		ip saddr @downstream counter packets 0 bytes 0 drop
	}

	chain antispoof {
		iifname . ip saddr @allowed accept
		counter packets 0 bytes 0 drop
	}

	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oifgroup 2 accept
		oif "lo" accept
		masquerade
	}

	chain input {
		type filter hook input priority filter; policy drop;
		jump custom-input
		ct state invalid counter packets 0 bytes 0 drop
		iifgroup 2 udp dport 68 counter packets 0 bytes 0 drop
		ct state established,related accept
		iifgroup 2 meta l4proto icmp accept
		iif "lo" accept
		iifgroup 2 counter packets 0 bytes 0 reject with icmp host-prohibited
		counter packets 0 bytes 0
	}

	chain forward {
		type filter hook forward priority filter; policy accept;
		jump custom-forward
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		oifgroup 2 counter packets 0 bytes 0 drop
	}

	chain custom-input {
	}

	chain custom-forward {
	}

	chain dnat-dns {
		type nat hook prerouting priority dstnat; policy accept;
		ip daddr 10.139.1.1 udp dport 53 dnat to 192.168.20.1
		ip daddr 10.139.1.1 tcp dport 53 dnat to 192.168.20.1
		ip daddr 10.139.1.2 udp dport 53 dnat to 10.139.1.1
		ip daddr 10.139.1.2 tcp dport 53 dnat to 10.139.1.1
	}
}
table ip6 qubes {
	set downstream {
		type ipv6_addr
		elements = { fd09:24ef:4179::a89:10 }
	}

	set allowed {
		type ifname . ipv6_addr
		elements = { "vif32.0" . fd09:24ef:4179::a89:10 }
	}

	chain antispoof {
		iifname . ip6 saddr @allowed accept
		counter packets 15 bytes 1072 drop
	}

	chain prerouting {
		type filter hook prerouting priority raw; policy accept;
		iifgroup 2 goto antispoof
		ip6 saddr @downstream counter packets 0 bytes 0 drop
	}

	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oifgroup 2 accept
		oif "lo" accept
		masquerade
	}

	chain _icmpv6 {
		meta l4proto != ipv6-icmp counter packets 0 bytes 0 reject with icmpv6 admin-prohibited
		icmpv6 type { nd-router-advert, nd-redirect } counter packets 0 bytes 0 drop
		accept
	}

	chain input {
		type filter hook input priority filter; policy drop;
		jump custom-input
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		iifgroup 2 goto _icmpv6
		iif "lo" accept
		ip6 saddr fe80::/64 ip6 daddr fe80::/64 udp dport 546 accept
		meta l4proto ipv6-icmp accept
		counter packets 0 bytes 0
	}

	chain forward {
		type filter hook forward priority filter; policy accept;
		jump custom-forward
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		oifgroup 2 counter packets 0 bytes 0 drop
	}

	chain custom-input {
	}

	chain custom-forward {
	}
}
table inet qubes-nat-accel {
	flowtable qubes-accel {
		hook ingress priority filter
		devices = { "eth0", "lo", "vif32.0" }
	}

	chain qubes-accel {
		type filter hook forward priority filter + 5; policy accept;
		meta l4proto { tcp, udp } iifgroup 2 oifgroup 1 flow add @qubes-accel
		counter packets 5761 bytes 440386
	}
}

What am I missing, why are guests not able to connect to any network?

Help is much appreciated!

It looks like qubes-nat-accel creates a routing dead-end and does not recognize your IPSec interface (nm-xfrm*)

Make a backup first, and try:

sudo nft flush chain inet qubes-nat-accel qubes-accel
sudo nft add rule inet qubes-nat-accel qubes-accel counter accept
sudo nft flush chain ip qubes custom-forward
sudo nft add rule ip qubes custom-forward iifname "vif*" oifname "eth0" counter accept
sudo nft add rule ip qubes custom-forward iifname "eth0" oifname "vif*" counter accept
sudo nft insert rule ip qubes forward iifname "vif*" oifname "eth0" counter accept
sudo nft insert rule ip qubes postrouting oifname "eth0" counter masquerade

@sys-whonix-user thanks for looking into this!

I have applied the commands, but unfortunately there is still no connection possible.

Here is the current ruleset for nftables:

table ip qubes {
	set downstream {
		type ipv4_addr
		elements = { 10.137.0.16 }
	}

	set allowed {
		type ifname . ipv4_addr
		elements = { "vif32.0" . 10.137.0.16 }
	}

	chain prerouting {
		type filter hook prerouting priority raw; policy accept;
		iifgroup 2 goto antispoof
		ip saddr @downstream counter packets 0 bytes 0 drop
	}

	chain antispoof {
		iifname . ip saddr @allowed accept
		counter packets 0 bytes 0 drop
	}

	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oifgroup 2 accept
		oif "lo" accept
		masquerade
		oifname "nm-xfrm*" masquerade
	}

	chain input {
		type filter hook input priority filter; policy drop;
		jump custom-input
		ct state invalid counter packets 0 bytes 0 drop
		iifgroup 2 udp dport 68 counter packets 0 bytes 0 drop
		ct state established,related accept
		iifgroup 2 meta l4proto icmp accept
		iif "lo" accept
		iifgroup 2 counter packets 0 bytes 0 reject with icmp host-prohibited
		counter packets 0 bytes 0
	}

	chain forward {
		type filter hook forward priority filter; policy accept;
		jump custom-forward
		ct state invalid counter packets 8 bytes 320 drop
		ct state established,related accept
		oifgroup 2 counter packets 0 bytes 0 drop
	}

	chain custom-input {
	}

	chain custom-forward {
		iifname "vif*" oifname "nm-xfrm*" accept
		iifname "nm-xfrm*" oifname "vif*" accept
	}

	chain dnat-dns {
		type nat hook prerouting priority dstnat; policy accept;
		ip daddr 10.139.1.1 udp dport 53 dnat to 192.168.20.1
		ip daddr 10.139.1.1 tcp dport 53 dnat to 192.168.20.1
		ip daddr 10.139.1.2 udp dport 53 dnat to 10.139.1.1
		ip daddr 10.139.1.2 tcp dport 53 dnat to 10.139.1.1
	}
}
table ip6 qubes {
	set downstream {
		type ipv6_addr
		elements = { fd09:24ef:4179::a89:10 }
	}

	set allowed {
		type ifname . ipv6_addr
		elements = { "vif32.0" . fd09:24ef:4179::a89:10 }
	}

	chain antispoof {
		iifname . ip6 saddr @allowed accept
		counter packets 12 bytes 904 drop
	}

	chain prerouting {
		type filter hook prerouting priority raw; policy accept;
		iifgroup 2 goto antispoof
		ip6 saddr @downstream counter packets 0 bytes 0 drop
	}

	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oifgroup 2 accept
		oif "lo" accept
		masquerade
	}

	chain _icmpv6 {
		meta l4proto != ipv6-icmp counter packets 0 bytes 0 reject with icmpv6 admin-prohibited
		icmpv6 type { nd-router-advert, nd-redirect } counter packets 0 bytes 0 drop
		accept
	}

	chain input {
		type filter hook input priority filter; policy drop;
		jump custom-input
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		iifgroup 2 goto _icmpv6
		iif "lo" accept
		ip6 saddr fe80::/64 ip6 daddr fe80::/64 udp dport 546 accept
		meta l4proto ipv6-icmp accept
		counter packets 0 bytes 0
	}

	chain forward {
		type filter hook forward priority filter; policy accept;
		jump custom-forward
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		oifgroup 2 counter packets 0 bytes 0 drop
	}

	chain custom-input {
	}

	chain custom-forward {
	}
}
table inet qubes-nat-accel {
	flowtable qubes-accel {
		hook ingress priority filter
		devices = { "eth0", "lo", "vif32.0" }
	}

	chain qubes-accel {
		type filter hook forward priority filter + 5; policy accept;
		ip daddr 10.137.0.0/16 accept
		ip saddr 10.137.0.0/16 accept
		meta l4proto { tcp, udp } iifgroup 2 oifgroup 1 flow add @qubes-accel
		counter packets 523 bytes 39314
	}
}

Hi guys,

issue still not solved for me but I have some more information to share:

I started to debug nftables and was able to extract a ping request from the AppVM to the internal network, with the following result:

trace id b9fddf05 ip qubes trace_chain packet: iif "vif63.0" ether saddr 00:16:3e:5e:6c:00 ether daddr fe:ff:ff:ff:ff:ff ip saddr 10.137.0.3 ip daddr 192.168.20.1 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 19819 ip length 84 icmp type echo-request icmp code 0 icmp id 50047 icmp sequence 1 
trace id b9fddf05 ip qubes trace_chain rule meta nftrace set 1 (verdict continue)
trace id b9fddf05 ip qubes trace_chain policy accept 
trace id b9fddf05 ip qubes prerouting packet: iif "vif63.0" ether saddr 00:16:3e:5e:6c:00 ether daddr fe:ff:ff:ff:ff:ff ip saddr 10.137.0.3 ip daddr 192.168.20.1 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 19819 ip length 84 icmp type echo-request icmp code 0 icmp id 50047 icmp sequence 1 
trace id b9fddf05 ip qubes prerouting rule iifgroup 2 goto antispoof (verdict goto antispoof)
trace id b9fddf05 ip qubes antispoof rule iifname . ip saddr @allowed accept (verdict accept)
trace id b9fddf05 ip qubes dnat-dns conntrack: ct direction original ct state new ct id 2583884433 
trace id b9fddf05 ip qubes dnat-dns packet: iif "vif63.0" ether saddr 00:16:3e:5e:6c:00 ether daddr fe:ff:ff:ff:ff:ff ip saddr 10.137.0.3 ip daddr 192.168.20.1 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 19819 ip length 84 icmp type echo-request icmp code 0 icmp id 50047 icmp sequence 1 
trace id b9fddf05 ip qubes dnat-dns policy accept 
trace id b9fddf05 ip qubes forward conntrack: ct direction original ct state new ct status dnat-done ct id 2583884433 
trace id b9fddf05 ip qubes forward packet: iif "vif63.0" oif "nm-xfrm-1846697" ether saddr 00:16:3e:5e:6c:00 ether daddr fe:ff:ff:ff:ff:ff ip saddr 10.137.0.3 ip daddr 192.168.20.1 ip dscp cs0 ip ecn not-ect ip ttl 63 ip id 19819 ip length 84 icmp type echo-request icmp code 0 icmp id 50047 icmp sequence 1 
trace id b9fddf05 ip qubes forward rule jump custom-forward (verdict jump custom-forward)
trace id b9fddf05 ip qubes forward policy accept 
trace id b9fddf05 inet qubes-nat-accel qubes-accel conntrack: ct direction original ct state new ct status dnat-done ct id 2583884433 
trace id b9fddf05 inet qubes-nat-accel qubes-accel packet: iif "vif63.0" oif "nm-xfrm-1846697" ether saddr 00:16:3e:5e:6c:00 ether daddr fe:ff:ff:ff:ff:ff ip saddr 10.137.0.3 ip daddr 192.168.20.1 ip dscp cs0 ip ecn not-ect ip ttl 63 ip id 19819 ip protocol icmp ip length 84 icmp type echo-request icmp code 0 icmp id 50047 icmp sequence 1 
trace id b9fddf05 inet qubes-nat-accel qubes-accel rule counter packets 28 bytes 2352 (verdict continue)
trace id b9fddf05 inet qubes-nat-accel qubes-accel policy accept 
trace id b9fddf05 ip qubes postrouting conntrack: ct direction original ct state new ct status snat,snat-done,dnat-done ct id 2583884433 
trace id b9fddf05 ip qubes postrouting packet: iif "vif63.0" oif "nm-xfrm-1846697" ether saddr 00:16:3e:5e:6c:00 ether daddr fe:ff:ff:ff:ff:ff ip saddr 10.137.0.3 ip daddr 192.168.20.1 ip dscp cs0 ip ecn not-ect ip ttl 63 ip id 19819 ip length 84 icmp type echo-request icmp code 0 icmp id 50047 icmp sequence 1 
trace id b9fddf05 ip qubes postrouting rule masquerade (verdict accept)
trace id 9cd6a30e ip qubes trace_chain packet: iif "eth0" ether saddr fe:ff:ff:ff:ff:ff ether daddr 00:16:3e:5e:6c:00 ip saddr 93.192.82.43 ip daddr 10.137.0.29 ip dscp cs0 ip ecn not-ect ip ttl 52 ip id 25238 ip length 160 udp sport 4500 udp dport 56559 udp length 140 udp checksum 14137 
trace id 9cd6a30e ip qubes trace_chain rule meta nftrace set 1 (verdict continue)
trace id 9cd6a30e ip qubes trace_chain policy accept 
trace id 9cd6a30e ip qubes prerouting packet: iif "eth0" ether saddr fe:ff:ff:ff:ff:ff ether daddr 00:16:3e:5e:6c:00 ip saddr 93.192.82.43 ip daddr 10.137.0.29 ip dscp cs0 ip ecn not-ect ip ttl 52 ip id 25238 ip length 160 udp sport 4500 udp dport 56559 udp length 140 udp checksum 14137 
trace id 9cd6a30e ip qubes prerouting policy accept 
trace id 9cd6a30e ip qubes input conntrack: ct direction reply ct state established ct status seen-reply,assured,confirmed,snat-done,dnat-done ct id 985409819 
trace id 9cd6a30e ip qubes input packet: iif "eth0" ether saddr fe:ff:ff:ff:ff:ff ether daddr 00:16:3e:5e:6c:00 ip saddr 93.192.82.43 ip daddr 10.137.0.29 ip dscp cs0 ip ecn not-ect ip ttl 52 ip id 25238 ip length 160 udp sport 4500 udp dport 56559 udp length 140 udp checksum 14137 
trace id 9cd6a30e ip qubes input rule jump custom-input (verdict jump custom-input)
trace id 9cd6a30e ip qubes input rule ct state established,related accept (verdict accept)
trace id 5f5c54d7 ip qubes trace_chain packet: iif "nm-xfrm-1846697" ip saddr 192.168.20.1 ip daddr 192.168.20.182 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 33170 ip length 84 icmp type echo-reply icmp code 0 icmp id 50047 icmp sequence 1 
trace id 5f5c54d7 ip qubes trace_chain rule meta nftrace set 1 (verdict continue)
trace id 5f5c54d7 ip qubes trace_chain policy accept 
trace id 5f5c54d7 ip qubes prerouting packet: iif "nm-xfrm-1846697" ip saddr 192.168.20.1 ip daddr 192.168.20.182 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 33170 ip length 84 icmp type echo-reply icmp code 0 icmp id 50047 icmp sequence 1 
trace id 5f5c54d7 ip qubes prerouting policy accept 
trace id 5f5c54d7 ip qubes forward conntrack: ct direction reply ct state established ct status seen-reply,confirmed,snat,snat-done,dnat-done ct id 2583884433 
----->trace id 5f5c54d7 ip qubes forward packet: iif "nm-xfrm-1846697" oif "nm-xfrm-1846697" ip saddr 192.168.20.1 ip daddr 10.137.0.3 ip dscp cs0 ip ecn not-ect ip ttl 63 ip id 33170 ip length 84 icmp type echo-reply icmp code 0 icmp id 50047 icmp sequence 1<----- 
trace id 5f5c54d7 ip qubes forward rule jump custom-forward (verdict jump custom-forward)
trace id 5f5c54d7 ip qubes forward rule ct state established,related accept (verdict accept)
trace id 5f5c54d7 inet qubes-nat-accel qubes-accel conntrack: ct direction reply ct state established ct status seen-reply,confirmed,snat,snat-done,dnat-done ct id 2583884433 
trace id 5f5c54d7 inet qubes-nat-accel qubes-accel packet: iif "nm-xfrm-1846697" oif "nm-xfrm-1846697" ip saddr 192.168.20.1 ip daddr 10.137.0.3 ip dscp cs0 ip ecn not-ect ip ttl 63 ip id 33170 ip protocol icmp ip length 84 icmp type echo-reply icmp code 0 icmp id 50047 icmp sequence 1 
trace id 5f5c54d7 inet qubes-nat-accel qubes-accel rule counter packets 28 bytes 2352 (verdict continue)
trace id 5f5c54d7 inet qubes-nat-accel qubes-accel policy accept

I have marked the problematic line (in my opinion), where the routing seems to send the response back to the virtual vpn device “nm-xfrm-1846697” instead of forwarding it back to the AppVM.

Here are some more details on the routing/addressing on the vpn qube:

user@sys-vpn-home-test:~$ sudo ip route show
default via 10.138.13.22 dev eth0 proto static metric 100 
10.138.13.22 dev eth0 proto static scope link metric 50 
93.192.82.43 via 10.138.13.22 dev eth0 proto static metric 50
user@sys-vpn-home-test:~$ sudo ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 192.168.20.182/32 scope global lo
       valid_lft forever preferred_lft forever
    inet6 fd80:db8:1:20::186/128 scope global nodad 
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group 1 qlen 1000
    link/ether 00:16:3e:5e:6c:00 brd ff:ff:ff:ff:ff:ff
    inet 10.137.0.29/32 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe5e:6c00/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever
4: nm-xfrm-1846697@NONE: <NOARP,UP,LOWER_UP> mtu 1400 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 
    inet 192.168.20.182/32 scope global noprefixroute nm-xfrm-1846697
       valid_lft forever preferred_lft forever
    inet6 fe80::e218:34c5:3ec6:7e5b/64 scope link stable-privacy proto kernel_ll 
       valid_lft forever preferred_lft forever
5: vif63.0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group 2 qlen 1000
    link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
    inet 10.137.0.29/32 scope global vif63.0
       valid_lft forever preferred_lft forever
    inet6 fe80::fcff:ffff:feff:ffff/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever
user@sys-vpn-home-test:~$ sudo nft list ruleset
table ip qubes {
	set downstream {
		type ipv4_addr
		elements = { 10.137.0.3 }
	}

	set allowed {
		type ifname . ipv4_addr
		elements = { "vif63.0" . 10.137.0.3 }
	}

	chain prerouting {
		type filter hook prerouting priority raw; policy accept;
		iifgroup 2 goto antispoof
		ip saddr @downstream counter packets 0 bytes 0 drop
	}

	chain antispoof {
		iifname . ip saddr @allowed accept
		counter packets 0 bytes 0 drop
	}

	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oifgroup 2 accept
		oif "lo" accept
		masquerade
	}

	chain input {
		type filter hook input priority filter; policy drop;
		jump custom-input
		ct state invalid counter packets 0 bytes 0 drop
		iifgroup 2 udp dport 68 counter packets 0 bytes 0 drop
		ct state established,related accept
		iifgroup 2 meta l4proto icmp accept
		iif "lo" accept
		iifgroup 2 counter packets 0 bytes 0 reject with icmp host-prohibited
		counter packets 0 bytes 0
	}

	chain forward {
		type filter hook forward priority filter; policy accept;
		jump custom-forward
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		oifgroup 2 counter packets 0 bytes 0 drop
	}

	chain custom-input {
	}

	chain custom-forward {
	}

	chain dnat-dns {
		type nat hook prerouting priority dstnat; policy accept;
		ip daddr 10.139.1.1 udp dport 53 dnat to 10.139.1.1
		ip daddr 10.139.1.1 tcp dport 53 dnat to 10.139.1.1
		ip daddr 10.139.1.2 udp dport 53 dnat to 10.139.1.2
		ip daddr 10.139.1.2 tcp dport 53 dnat to 10.139.1.2
	}
}
table ip6 qubes {
	set downstream {
		type ipv6_addr
		elements = { fd09:24ef:4179::a89:3 }
	}

	set allowed {
		type ifname . ipv6_addr
		elements = { "vif63.0" . fd09:24ef:4179::a89:3 }
	}

	chain antispoof {
		iifname . ip6 saddr @allowed accept
		counter packets 14 bytes 1016 drop
	}

	chain prerouting {
		type filter hook prerouting priority raw; policy accept;
		iifgroup 2 goto antispoof
		ip6 saddr @downstream counter packets 0 bytes 0 drop
	}

	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oifgroup 2 accept
		oif "lo" accept
		masquerade
	}

	chain _icmpv6 {
		meta l4proto != ipv6-icmp counter packets 0 bytes 0 reject with icmpv6 admin-prohibited
		icmpv6 type { nd-router-advert, nd-redirect } counter packets 0 bytes 0 drop
		accept
	}

	chain input {
		type filter hook input priority filter; policy drop;
		jump custom-input
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		iifgroup 2 goto _icmpv6
		iif "lo" accept
		ip6 saddr fe80::/64 ip6 daddr fe80::/64 udp dport 546 accept
		meta l4proto ipv6-icmp accept
		counter packets 0 bytes 0
	}

	chain forward {
		type filter hook forward priority filter; policy accept;
		jump custom-forward
		ct state invalid counter packets 0 bytes 0 drop
		ct state established,related accept
		oifgroup 2 counter packets 0 bytes 0 drop
	}

	chain custom-input {
	}

	chain custom-forward {
	}
}
table inet qubes-nat-accel {
	flowtable qubes-accel {
		hook ingress priority filter
		devices = { "eth0", "lo", "vif63.0" }
	}

	chain qubes-accel {
		type filter hook forward priority filter + 5; policy accept;
		meta l4proto { tcp, udp } iifgroup 2 oifgroup 1 flow add @qubes-accel
		counter packets 32 bytes 2688
	}
}

Not sure what else is required, but it seems that others also are clueless here.

As a fallback I can set up an OpenVPN server and try with this, but wiould prefer a solution to the current problem.

Thanks again to everybody reading this!