Link to home
Start Free TrialLog in
Avatar of fosiul01
fosiul01Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Ping delay[ Need explanation]

HI
i have configured my router with 3 ethernet card

eth0= [isp1]=192.168.2.120
eth1=[Internal]=10.0.0.1
eth2 =[isp2] = 192.168.2.10

Everything is running fine. Ineternal pc and server itself can resolv any dns query from both eth0 and eth2

but if i shutdown eth0. so all trafiq is going through eth2 , which is fine
but if try to ping a web site ( any) suppose ping gmail.com  or ping 78.25.268.45
there would be a few second[3to4] daly before it will starts to ping
i guess its before, its trying to go via eth0 , then it found out eth0 is not working then it diverts to eth2 , hense the delay.

am i right ?? or there is something i need to do to make this fast ??
                                                     
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

do eth0 and eth2 have the same netmask?
Avatar of fosiul01

ASKER

[root@dhcp ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.255.255.0   U     0      0        0 eth1
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth2
169.254.0.0     *               255.255.0.0     U     0      0        0 eth2
default         192.168.2.1     0.0.0.0         UG    0      0        0 eth0
are eth0 and eth2 on the same lan segment?

are bells starting to ring? can you see where I'm going with this?
... I also need my eyes tested... looked at the 169 mask by mistake...

anyway, what happens if you change the netmask for eth2 to say 255.255.255.240

omm how will i do that ??
also
why 169.254.0.0     *               255.255.0.0     U     0      0        0 eth2 mask is there ??

SOLUTION
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i am following this tutorial :http://www.linuxquestions.org/linux/answers/Networking/Linux_Router_Configuration_0

omm you need to look at this one

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.255.255.0   U     0      0        0 eth1
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth2
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
default         home            0.0.0.0         UG    0      0        0 eth2
default         192.168.2.1     0.0.0.0         UG    0      0        0 eth0

look at this :  default         home            0.0.0.0         UG    0      0        0 eth2

when i reboot the pc, then i can only ping via eth0 [ which is first isp]
then i need to add another gateway to allow trafiq to go via eth2
by adding this command : route add default gw 192.168.1.254 dev eth2
in Gatway , why its saying home ??
ok after putting zeroconf=false,

this is the output
[root@dhcp etc]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.255.255.0   U     0      0        0 eth1
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth2
default         home            0.0.0.0         UG    0      0        0 eth2
default         192.168.2.1     0.0.0.0         UG    0      0        0 eth0


note : if i turned off eth0. now if i ping any ip its fine : ping 78.25.36.36  [ Fine, quickly as eth0]
only if i ping domain then there is a dealy                    ping gmail.com  [ thinking couple of second, then start to ping]

I have added dns server address of 2nd isp to /reslov.conf

I think it's getting confused as to what interface to use (you get something like this in solaris if you have the same netmask on multiple devices, or at least you used to). Having 2 default routes is also confusing matters.

Have you tried changing the netmask of one of the interfaces to see if it fixes the delay issue, it would be a quick check.

Get rid of one of the default routes.
omm but i need 2 default routes, other wise when i turned of one routes, other routes does not work.
i have change the 255.255.255.0 to  255.255.255.240 , as you said but then i am unable to ping my router!! because the netmask of my router is 255.255.255.0

i cant change that, its would be a pain ,

you can add a static route for the other interface.
you know its wired

in the server at resolv.conf

i have 2 nameserver

nameserver 192.168.2.1
nameserver 192.168.1.254  [ problematic one]

now if change this order like this

nameserver 192.168.1.254
nameserver 192.168.2.1

now if shutdown eth0 . so all trafiq should go via eth2

now if try to ping by domain  : ping gmail.com

it will just stuck , it will not ping!!!!

but with the first order, it ping but little bit delay

what do you think of this ??

As i said [ if i try to ping any public ip, its fine, only problem if i try to ping domain]

what i will do is, i will configure this server as dns server, then see what happended
What are you trying to accomplish?

What are the real IP addresses of the 3 NIC's.  You stated that eth0 was 192.168.2.120 and that eth2 was 192.168.2.10, but you route table shows that eth2 is on 192.168.1.0/24.

You stated that you needed two default routes.  Think about it, you can't have two defaults of anything.  You can only have 1 default.  If you have 2 of anything, then you need to make a decision about which one to use.
I said 2 default route, because, if one isp is down so trafiq will not go via eth0, so trafiq will have to go via eth2

now if you dont add the default routes for eth2 which is 192.168.1.254 , then how internal nework will know which way to go ??

if i delete 2nd route, then if i shutdown eth0, then if try to ping any thing, it will say network unreacheble or it ping fail because pc is thinking internet is down
It now sounds likt you're trying to do some sort of failover rather than sort a ping/routing/configuration issue.
Isnt this related?
   https://www.experts-exchange.com/OS/Linux/Q__23897841.html

You're doing it again arent you... Can you ask one question at a time or create related questions for different issues please.

failover is fine.

what i just want to know, why there is a delay when i am trying to ping a domain ??

do you think, i should setup this servcer as dns server , and it will fast domain ping problem ??
hahahahhahah yes that question is related to same network. but thats different sort of problem!!!

and its different sort of problem

i will close that one soon.
That will not work.  You can define two default routes, the 1st one will be used all of the time until it 'fails', then the second one will be used.  The problem is what defines a "failure".  From the linux system point of view the failure  is if eth0 detects that it is no longer physically connected.  This would mean a NIC failure, a LAN cable failure, or what ever it is connected (hub/switch/router) to failure.

Typically when you loose connection to the Internet it is a WAN (includes DLS or cable connections) failure.  Take the following picture:

     PC <-- eth0 --> Router <-  WAN connection -> Internet

If the WAN connection fails, the PC can still get to the router, so the PC still sees this as active and will still attempt to send data over this path.  Now, if the router fails or the cable between the PC and the router were to fail, then the PC would see this as a failure and start attempting to send data over another path if one is available.

What you need in order to try and get fail over is either a single router that has both ISP connections in it or setup both routers and the PC with dynamic routing functions (such as OSPF) where a WAN failure will cause the router to send route updates to the PC.

What type of Internet connections are these and what type of routers are being used to connect to your ISPs?
so if i take your word :
"
If the WAN connection fails, the PC can still get to the router, so the PC still sees this as active and will still attempt to send data over this path.  Now, if the router fails or the cable between the PC and the router were to fail, then the PC would see this as a failure and start attempting to send data over another path if one is available."

thats why there is a ping delay  when request is going via eth2 ??


its dsl connection : one is connected via BT router , anotehr one is connected via Rubbish belkin
it could have been a typo and he meant can't
That is the way it works and I did mean "can".  You can even test this.

On your PC start ping'ing the IP adress of the DSL router/modem to the BT link.  Then disconnect the phone line going into the the DLS router/modem.  The pings still work.  The connect from your PC to the router is still up and running, so it will still us this as it (your PC) has no clue that the "far side" of the connection is down.


Now IIRC dead gateway detection takes about 30 seconds to realize that the next hop is dead an to start using another hop.  So, if you were to power down the DSL router/modem it may take up to 30 seconds for Linux to realize that path is dead and to start using the other default path.  And once that path comes back it may NOT automatically get added back to the routing table and you may have to manually add that route back.

Static routing is not designed to have redundant paths and fail over.  That is what dynamic routing protocols are for.

You may want to look for a DLS router/modem that supports dual DSL connections.  Or you might be able to use these guides to do what you are trying to do. These include information on using other Linux based programs/functions/scipts to ping the gateways/routers and hosts on the Internet to try and detect that something has failed:

http://blog.taragana.com/index.php/archive/how-to-configure-dual-adsl-cable-connections-firewall-gateway-nat-with-shorewall-firewall/

http://blog.taragana.com/index.php/archive/how-to-load-balancing-failover-with-dual-multi-wan-adsl-cable-connections-on-linux/
but program is : why delay in domain ping ??
[ as i said earlier, if i ping 78.10.25.25 = [its fine no delay] . but if ping gmaill.com  [ there would be dealy]

ip ping is fine, but when i am trying to ping domain, there is a dealy, if i take your word, then

if i try to ping ip and ping domain everything would be delay

not only domain...

ommmm does it anything to do with tcp and udp ??
My guess is that the delay is not in the actual ping, but is a delay in doing the name look up to get what IP address gmail.com is, because the 1st DNS server it is configured to go to is now not available and typically name look ups have a 30 second timeout before they go to the next DNS server in the list.
yes, thats it

its the delay in name look up.

about your comments: typically name look ups have a 30 second timeout before they go to the next DNS server in the list.

i belived as well this is the problem ...

but is there any documents to backup this theory ??
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks i will work on that

thanks to you and jools for the time