Centos and Red Hat:
/etc/sysconfig/network
/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=myhost
GATEWAY=123.123.123.1
Ubuntu/Debian:/etc/network/interfaces
gateway 192.168.1.254
Command Line:
route add default gw 192.168.1.254