Openvpn for only one guest network

Hello.

I started using openwrt 22.3.5 and successfully created a vpn client on it.

I want vpn client to be available only on one specific guest wifi.

Could you please help me achieve this task?

thanks.

Configure your firewall and routing rules so that only devices in the guest wifi subnet can use the VPN, while everyone else goes out the front door.

Could you please show how to do it? I know what to do in theory, but cannot accomplish it.

Disable gateway redirection.

# /etc/config/network

config rule
        option src '192.168.2.0/24' # Guest subnet
	    option lookup '100'

config route
        option interface 'vpn' # OVPN logical interface name
	    option target '0.0.0.0/0'
	    option table '100'
1 Like