LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-29-2015, 04:00 AM   #1
slowerogue
Member
 
Registered: Oct 2012
Posts: 93

Rep: Reputation: Disabled
routing using default gw or 0.0.0.0


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



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

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

its quite confusing to me sometimes 0.0.0.0 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 04:01 AM.
 
Old 09-29-2015, 07:04 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 865

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 0.0.0.0 for the destination.

ie in your B example you have a default gateway of 10.10.200.1 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, 09:09 AM   #3
slowerogue
Member
 
Registered: Oct 2012
Posts: 93

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 192.168.248.1xx/32, 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 192.168.248.1xx ip.

Correct me if im wrong.
Code:
A default gw - 172.19.0.1  
B default gw - 10.10.200.1
So, when i add route
Code:
A #route add -host 192.168.248.xxx/32 dev eth2
B #route add -host 192.168.248.xxx/32 gw 10.10.200.1 dev

My question is, why MUST A use 0.0.0.0 and B MUST use 10.10.200.1?

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


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


All times are GMT -5. The time now is 04:00 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration