Change Default Gateway Linux Command

Mobile
feeds
Welcome Login | Register

Change Default Gateway Linux Command
Reply Your Comments:
Click this button if you are interested in replying to this topic and leave your comments
Sent To Friend
CLick this button if you want to send this page to a friend.
Subsribe To Rss Feeds
Subscribe to RSS
CLick this button if you want to subscribe to this RSS Feed. You can use your browsers feeds burners if you have mozilla or internet explorer 7 or higher and keep up with updates.
  Forums Index
      » Linux Hosting Forums
        » » Change Default Gateway Linux Command
Change Default Gateway Linux Command
Post Description: change default gateway linux command Linux Hosting
Post Tags:
This Post Has Been Viewed 27183 Times Since Thu Aug 24, 2006 5:53 pm Author hostman with 7 replies
Change Default Gateway Linux Command
Advertise On This Page




Does anyone know how to change my default gateway in the command link in the linux shell?

Thanks


Leave Your Comments

Share:   Subscribe - Keep Up With This Topic
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites
URL:
To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
Fourms BBCODE:
Links Related to : Change Default Gateway Linux Command
Add Link:

Comments and replies About Change Default Gateway Linux Command
:: 1 :: Reply #95 Reply By hostman On Thu Aug 24, 2006 6:02 pm
hostman:
If you want to chage the default gateway in linux using the linux shell, do this:

Execute this comand to display your network configuration:

     Code:
cat /etc/sysconfig/network


It will show something like this:

     Code:
NETWORKING=yes
HOSTNAME=host.domain.com
GATEWAY=210.96.156.101


In this example, my gateway is set to 210.96.156.101 If you want to change it, user your favorite editor and edit, then save it. I like using nano or VI. if you find vi hard to master, use nano, its much easier to use. if you are going to us nano, execute this command to edit:


     Code:
nano /etc/sysconfig/network


Please note in this example i am using Redhat/Fedora distribution.
:: 2 :: Reply #13881 Reply By oorangeboy On Fri Aug 03, 2007 8:20 am
oorangeboy:
worked like a charm thanks.
:: 3 :: Reply #54851 Reply By tebza On Fri May 23, 2008 3:21 am
tebza:
i want to change a default gateway on my linux client, what should i type in the command shell?
:: 4 :: Reply #61310 Reply By snehal On Fri Jul 11, 2008 2:28 pm
snehal:
u can even try.

route add default gw 192.168.0.1

replace 192.168.0.1 with your ip, to delete route replace "add" with "delete"
:: 5 :: Reply #83765 Reply By hoavn On Thu Nov 27, 2008 11:14 pm
hoavn:
thanks you very much. it's useful with me.
:: 6 :: Reply #98799 Reply By wallpaperama On Mon Mar 30, 2009 6:23 pm
wallpaperama:
30p-303-linux-default-gateway.gif
if you have fedora or redhat or centos you can just send this command and select network from the list, there you can change the default gateway too.

the command to get the utility as in my pictures is this:

LINUX SHELL COMMAND:
setup


hope the image helps
:: 7 :: Reply #99710 Reply By sharid On Tue Apr 07, 2009 8:48 pm
sharid:
please sir i am sharid from india, how can i change my network gateway through command