OpenVPN Split Tunneling (specify apps that go through VPN tunnel)

hey zilexa, I’ve been into similar problem myself and I’ve seen your posts.
Today I was able to make it work for me.
Although I think it’s not the best solution, but it’s the working one, so, here’s my latest history.

ip netns add ns2
ip link add vns2a type veth peer name vns2b
ip link set vns2b netns ns2
ip netns exec ns2 ifconfig vns2b 10.1.2.1/24 up
ifconfig vns2a 10.1.2.2/24 up
ping 10.1.2.1
ip link set tun0 netns ns2
ip netns exec ns2 ip link set tun0 up
ip netns exec ns2 ip addr add 10.10.0.6/24 dev tun0 # I set /24 network so that I could do the next step
ip netns exec ns2 ip route add default via 10.10.0.5
ip netns exec ns2 ping 8.8.8.8
ip netns exec ns2 ping google.com # would not work yet, we need to set dns so…
mkdir -p /etc/netns/ns2
echo “nameserver 8.8.8.8” > /etc/netns/ns2/resolv.conf
echo “nameserver 8.8.4.4” > /etc/netns/ns2/resolv.conf
ip netns exec ns2 ping google.com # should work great
ip netns exec ns2 wget http://icanhazip.com -qO- # should return your vpn ip

I did it while openvpn service was running.
I’m not sure if it will remain after reboot.