OpenVpn to allow a particular ip address

So I setup openVpn by following this:

I have setup a static ip address for one of my laptops. I need that ip address - - to only ever use the vpn as setup in the link.

I have tried using "VPN Policy Routing" but to no avail. In dd-wrt i just set the static ip in the "pbr" field and everything was good to go - is there some similar plugin or anything at all that does this?

echo "100 vpn" >> /etc/iproute2/rt_tables

Add the following rule and routes in /etc/config/network

config rule
        option in     'lan'
	option src   ''
	option lookup '100'

config 'route' 'name_your_route'
        option 'interface' 'vpn'
        option 'target' ''
        option 'netmask' ''
        option 'gateway' 'gw_to_the_vpn'
        option 'table' '100'

config 'route' 'lan route'
        option 'interface' 'lan'
        option 'target' ''
        option 'netmask' ''
        option 'table' '100'

Restart network.



so I finally have time (ie nobody needs the internet for a day or two!) to try this out -

so is the only thing that need editing the value "gw_to_the_vpn"? And would I just set it to the value of the end vpn - ie if my vpn makes it look like my ip is, would that be the value "gw_to_the_vpn"?

Or would it be something else?

Yes, that's correct. You can try to omit it and hope that auto-detect will fill the gateway automatically in.