Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-29-2015, 03:00 AM   #1
Registered: Oct 2012
Posts: 96

Rep: Reputation: Disabled
routing using default gw or

Hi guys
I am having some confusion using the route in linux.
[root@AAA network-scripts]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface UH        0 0          0 eth2   U         0 0          0 eth2         UG        0 0          0 eth2

[root@BBBB network-scripts]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface UGH       0 0          0 bond0     U         0 0          0 bond0         UG        0 0          0 bond0
A uses to route, able to ping.
A uses its own gateway to route, not able to ping

B uses to route, not able to ping
B uses its own gateway to route, able to ping.

its quite confusing to me sometimes to successful to ping, but sometimes it's the default gateway. because in my understanding the default route will route to the default gateway, and in my example above, they shouldnt be any differences, right?

Please kindly help...THXXXXXXXXXX <3

Last edited by slowerogue; 09-29-2015 at 03:01 AM.
Old 09-29-2015, 06:04 AM   #2
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 866

Rep: Reputation: 264Reputation: 264Reputation: 264
You seem very confused.

Firstly you have given an incomplete picture of your network topology, you have 3 different network blocks in use?
Second you seem to have the default gateway confused in your routing table, the default gateway is the one with for the destination.

ie in your B example you have a default gateway of and you also have a host only route to that same gateway which is redundant unless your doing something more complicated that you have failed to mention.

So perhaps you could explain your :-
1. Network layout
2. Your complete routing table
3. What exactly you're pinging

FYI Don't bother hiding parts of private IP address ranges you'll only confuse yourself and wont protect yourself as they are not routable across the internet anyway
Old 09-29-2015, 08:09 AM   #3
Registered: Oct 2012
Posts: 96

Original Poster
Rep: Reputation: Disabled
Hi , thanks for the reply.
The reason im hiding the ip because i dont want the people who is working on this project know im posting this(providing the two gateway, and the eth they might recognize it ><).. the same reason why i filter out the routing table because there are other routing information they might recognize(differernt eth)

Sorry i cant provide any network topology simply because i do not know them at all. Actually i am a system admin, not a network guy. The only thing i know is i need add route to ping to the ip, using the gateway provided by the network guy.
These are just 2 examples out of hundred over server i am working on.

So the network guy told me to use their own default gateway to route to the ip.

Correct me if im wrong.
A default gw -  
B default gw -
So, when i add route
A #route add -host dev eth2
B #route add -host gw dev

My question is, why MUST A use and B MUST use

Last edited by slowerogue; 09-29-2015 at 08:11 AM.


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
[SOLVED] twisted routing to the default gateway vincix Linux - Newbie 2 02-15-2014 04:05 PM
VLAN routing/default gateway ? bala.linux Linux - Networking 8 03-18-2009 04:16 AM
redirect routing on non-default interface docawk Linux - Networking 2 12-26-2008 04:52 PM
[Help Needed] TWO DEFAULT GW - Routing problem igoruch Linux - Networking 9 07-02-2006 04:32 PM
Double default gw in routing table ?? Help!! poj Linux - Networking 17 07-14-2004 07:05 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:52 PM.

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