Linux - Setting a Default Gateway

First of all run the command to enter the default gateway,

route add default gw

Then to make sure it survives a reboot, edit the file '/etc/sysconfig/network' and add the line below. Of course changing the IP address to your default gateway - GATEWAY=

About the Author


R Donato

Rick Donato is the Founder and Chief Editor of He currently works as an SDN/NFV Solutions Architect and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001