Make sure port 22 is not blocked by your ISP. Some providers block ports by default and you need to apply to open them for you. Quick way to verify, run a tcpdump on your wan interface tcpdump -i pppoe-wan tcp port 22
The redirect snippet is correct.
OK, I don't understand why you're telling me that. You just pasted /etc/config/network - so as I noted, just delete WAN6 interface to disable WAN IPv6:
config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'
This is irrelevant. Is your ISP using carrier grade nat or blocking in general incoming connections? Do you have a routable public IP on wan interface?
I don't quite understand this question, as you asked for WAN or WAN6 access to your device. I surmise that you are issued public IPv6 addresses on the WAN6, and that you have public LAN IPs too.
If you use a non-Public IPv6 address in your rule, it will not work.
If you use this IPv6 rule, it's unrelated to any IPv4 addressing
Some options to better secure the rule are:
Know the source network/IP of the IPv6 traffic and specify a SRC IP/range
I made a test using a non-OpenWRT modem and I could reach my server, so I'm pretty sure it's a OpenWRT problem, but I can't find which one
Edit: Okay I found the problem. OpenVPN on my server blocks the port. When OpenVPN is connected, the port is blocked. I just don't understand why connecting thru my local lan using my server's ip address works, and from outside reaching my public ip address doesn't
It's not in my /etc/config/network because OpenVPN is only running on my server, it's not in OpenWRT router
I just don't understand why when I'm in my lan I can connect to my server via it's local IP and when I'm outside my lan I can't. The router doesn't redirect the traffic like it was inside the lan?
This isn't a OpenWrt issue then. You likely didn't enable these on the Access Server:
Should client Internet traffic be routed through the VPN?
AND
Should clients be allowed to access network services on the VPN gateway IP address?
When you say "outside your LAN" do you mean with a VPN connection, or using port forward from WAN???
Are you trying to run OpenVPN on port 22/tcp (I'm not sure how 22/tcp applies to OpenVPN) !!?! If so, can you verify that you're not running 22/tcp anywhere else (SSH ON SERVER, SSH ON ROUTER, etc.)?
I would try using a port other than 22/tcp
Did you open the UDP port too!?!?
Lastly, this is wrong in your IPv4 firewall rule:
option src_dport '22'
There should be no source port, only the DEST port 22/tcp should be specified. You don't know what SRC port the client will use.