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 27208 Times Since Thu Aug 24, 2006 5:53 pm Author hostman with 10 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

Your Name
Your Email Address (Will Not Be Published)
Notify Me When Someone Replies to this Page
(An email will be sent to you when someone replies to your comments)
Your Comments
Include A Picture with your comments
Share
| More
Share this page by putting this URL in your comments to other websites like myspace, Facebook, Twitter friendster, Hi5, Groups, Boards, Forum or others. Just Copy and Paste this Code
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
BBCODE:
Subscribe Feeds
Webmasters - Exchange Links With Us. Add related websites to this topic
Add Link:
Links Related to : Change Default Gateway Linux Command

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
:: 8 :: Reply #113724 Reply By Nagaraj On Tue Aug 25, 2009 2:44 am
Nagaraj:
pls send it
:: 9 :: Reply #115525 Reply By maruf On Mon Sep 14, 2009 4:29 am
maruf:
14-303-red-roses-photo.jpg
please send my linux related information every day
:: 10 :: Reply #115781 Reply By Josh On Thu Sep 17, 2009 1:49 pm
Josh:
great! see the below url also

basilvarghese.co.cc/linux-networkin