Skip to content

Instantly share code, notes, and snippets.

@sapran
Created October 29, 2018 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sapran/b84610e69ba2260218d264dc1233be2e to your computer and use it in GitHub Desktop.
Save sapran/b84610e69ba2260218d264dc1233be2e to your computer and use it in GitHub Desktop.
ip rule add from $(ip route get 1 | grep -Po '(?<=src )(\S+)') table 128
ip route add table 128 to $(ip route get 1 | grep -Po '(?<=src )(\S+)')/32 dev $(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)')
ip route add table 128 default via $(ip -4 route ls | grep default | grep -Po '(?<=via )(\S+)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment