Manually adding a default route to a CentOS Linux host

I have come to rely on the CentOS and Fedora network initialization scripts to add default routes, but a situation occurred where I needed to add one manually. The route command syntax differs between Solaris, Linux and OpenBSD, so I thought I would jot down how I manually added a static route to my Linux host for future reference:

$ ip route add 0.0.0.0/0 via 192.168.1.1 dev bond0

1 thought on “Manually adding a default route to a CentOS Linux host”

  1. Ooh, good one. I never remember to note the quick-and-easy template and end up scrubbing the man page for 5 minutes.

Leave a Reply

Your email address will not be published. Required fields are marked *