sudo netstat -nr
  1. #!/bin/bash
  2. sudo netstat -nr|grep tun0|grep -v utun0|grep -v lo0|grep -v 10.2|grep UGSc|cut -d ' ' -f 1|xargs -I{} sudo route delete -net {} -interface tun0 && sudo netstat -nr|grep tun0|grep -v utun0|grep -v lo0|grep -v 10.2|grep UGHS|cut -d ' ' -f 1|xargs -I{} sudo route delete -host {} -interface tun0
Parsed in 0.003 seconds