How to Add or create default gateway from terminal in Ubuntu

How to Add or create default gateway from terminal in Ubuntu
I've been so rarely using terminal for my working in ubuntu, and sometime i have to use terminal to remote my server.

I ll share you "How to Add or create default gateway from terminal in Ubuntu"
because i have cased for changing default gateway on my server.
I had a little confused before but i found an article and it was helpful.

It,s piece of cake.

1.

open terminal

2

sudo route add default gw 192.168.1.251 eth0

sudo /etc/init.d/networking restart

done!