LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2014, 12:29 PM   #1
phpshell
Member
 
Registered: Nov 2012
Posts: 46

Rep: Reputation: Disabled
Unhappy my default gateway not able to change


anybody can help to change my default gateway permanently on my pc to be

0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1






[root@localhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
10.0.0.0 0.0.0.0 255.255.254.0 U 1 0 0 eth0
172.0.0.0 10.0.0.1 255.0.0.0 UG 0 0 0 eth0
10.0.0.0 10.0.0.1 255.0.0.0 UG 0 0 0 eth0
152.0.0.0 10.0.0.1 255.0.0.0 UG 0 0 0 eth0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0


[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAYDEV=eth1
GATEWAY=192.168.1.1

also i tried to changed from this directory
[root@localhost ~]# cat /etc/sysconfig/networking/profiles/default/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAYDEV=eth1
GATEWAY=192.168.1.1



[root@localhost ~]# service network restart

I am still getting same route

[root@localhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
10.0.0.0 0.0.0.0 255.255.254.0 U 1 0 0 eth0
172.0.0.0 10.0.0.1 255.0.0.0 UG 0 0 0 eth0
10.0.0.0 10.0.0.1 255.0.0.0 UG 0 0 0 eth0
152.0.0.0 10.0.0.1 255.0.0.0 UG 0 0 0 eth0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0


only one way can be work by add like below which lost it when I restart pc
route del -net 0.0.0.0/0 gw 10.0.0.1
route add -net 0.0.0.0/0 gw 192.168.1.1

Last edited by phpshell; 02-03-2014 at 12:32 PM.
 
Old 02-03-2014, 02:06 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello,

which distribution is this? which tool are you using to configure the network? You will have to make the changes with the same tool which you've used when you configured the network before. Otherwise you will never delete these settings.

You should read the documentation of the distribution in order to find out how to change those settings.

Maybe it would help to delete the network completely and then configure a new one.

Markus
 
Old 02-03-2014, 03:48 PM   #3
phpshell
Member
 
Registered: Nov 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
my default gateway not able to change

hi
Please be inform these configuration had done manually without any tools
i just configured these two files to be static

/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the default gateway? shams Linux - Networking 3 02-14-2013 09:01 PM
[SOLVED] change default Gateway amartlk Linux - Networking 10 12-23-2011 07:19 AM
How do I change the default gateway? tbruer1138 Linux - Networking 3 03-10-2005 09:21 PM
Cannot change default gateway parr Linux - Networking 22 07-31-2003 07:13 PM
want to change default gateway juanb Linux - General 1 03-12-2003 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration