OpenVPN connect to network with same ip range

#!/bin/bash
 
# delete routing for whole network
sudo route del -net 192.168.1.0 netmask 255.255.255.0 dev tap0
 
# add route to hosts
for ip in {30..50}; do
	sudo route add 192.168.1.${ip} dev tap0
done