0

I'm using OpenVPN on Windows. I have followed the instruction from this question OpenVPN: Only route a specific IP addresses through VPN? to be able to route traffic to a single IP or an entire subnet through the VPN.

route-nopull 
route 192.168.0.0 255.255.255.0

However, is it possible for me to route traffic to a range of IP addresses, for example only traffic that destined to IP 192.168.0.200 to IP 192.168.0.255 only?

1 Answer 1

2

A route is working with network/netmask only. A range can be expressed by an union/sum of networks/netmasks. So:

192.168.0.200:192.168.0.255

is equivalent to the union/sum of:

192.168.0.200/255.255.255.248
192.168.0.208/255.255.255.240
192.168.0.224/255.255.255.224

Your new piece of configuration should become:

route-nopull
route 192.168.0.200 255.255.255.248
route 192.168.0.208 255.255.255.240
route 192.168.0.224 255.255.255.224

The (*nix) tool used to easily calculate those ranges was netmask.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .