Skip to content

Instantly share code, notes, and snippets.

@NrI3
Last active March 17, 2020 18:00
Show Gist options
  • Save NrI3/20ebed929e2b38aea4cc316c468bfa6e to your computer and use it in GitHub Desktop.
Save NrI3/20ebed929e2b38aea4cc316c468bfa6e to your computer and use it in GitHub Desktop.
Routing linux
# show all routes
ip route
# add route
ip route add [network/mask] dev [interface]
ip route add 192.168.0.0/24 dev ens33
# delete route
ip route del [network/mask]
ip route del 192.186.0.0/24
# add gateway
ip route add default via [gateway]
ip route add 0.0.0.0/0 via 192.168.0.1
ip route add default via 192.186.0.1
# show routes numeric
route -n
# empty routes table
ip route flush table main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment