How to setup gateway Centos 6 commandline

If you’ve just finished setting up your Centos and completed the network configuration from my previous post. You are probably wondering why your internet is down again after you have restarted your VM. Reason is, you probably haven’t setup any gateway yet. To set the gateway you need to open and edit the file with your favorite editor, in my case “vim” editor.

vi /etc/sysconfig/network

add the line

GATEWAY=

then issue an

/etc/init.d/network restart

make sure you are root user.

Leave a Reply

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