I would like To have access To the LAN of the Openwrt router from openvpn, Now i only have access To thé wan and the Web interface of the openwrt router.
In fact because my openwrt is behind another router it's not directly exposed to the internet (no DMZ on the first router only one port redirected for OpenVPN), so it's not that dangerous to access LAN from WAN isn't it ? (simple curious question because of redirect for OpenVPN is enough i will only do that one)
How can i do the port forward for the OpenVPN access please ?
You still forwards ports, regardless if it's: single, double, etc. NATing, so I don't understand the perceived added safety of a downstream device.
I'm not that familiar with OpenVPN specifically. I only surmise that you placed the (Layer 3) tunnel in it's own firewall zone. If so, you would Traffic Rule (not Port Forward, since no NAT is involved), allowing access to whatever IP/port as you normally would.
uci add firewall rule
uci set firewall.@rule[-1].name='ACCEPT VPN to LAN traffic'
uci set firewall.@rule[-1].src='vpn'
uci set firewall.@rule[-1].dest='lan'
uci set firewall.@rule[-1].proto='all'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
service firewall restart
I think it will be good but I have to create a "vpn" zone, do you know how to do it, i'm not sure of what i found ?
P.S : the openwrt router is added as a repeter on my bedroom (the principal router is too far away), and it's the only one where i can do what i want (my internet provider isn't providing OpenVPN/adbloker/QOS ect... support)
You didn't tell us what "didn't work". You can try verifying that the zone was created and that the tunnel was added to it. Then verify your zone configs.
config interface 'vpn'
option ifname 'tun0'
option proto 'dhcp'
and this to /etc/config/firewall :
config zone 'vpn'
option name 'vpn'
list network 'vpn'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list device 'tun0'
config rule 'ovpn_lan'
option name 'ACCEPT VPN to LAN traffic'
option src 'vpn'
option dest 'lan'
option proto 'all'
option target 'ACEPT'
And I have removed the list device 'tun0' from the lan zone one the firewall.
After this i was still unable to reach the lan (192.168.1.X) from an openvpn connection (192.168.8.X).
Well, I'm done helping here...I think this is beyond my strong-point (I work with Wireguard more so). I only provided assistance because @ulmwind (who was helping) started requesting remote access and making off-topic comments.
OpenVPN is not my main forte; and I'm starting to get a feeling (from these antics) - that it may be an OpenVPN config that needs work instead.
@anon50098793, @eduperez, @trendy - can you help out @vic1707? ...someone's being "un-nice" to him (and offering quite dangerous things in exchange for assistance).