Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sun Dec 10, 2023 6:22 am


Internet Protocol, Transport Control Protocol, Network protocols, Routing, Routers, IP aliases, Routes, Ethernet

Author Message
mandrei99
Post  Post subject: How to dump kernel route cache in Linux  |  Posted: Mon Jan 12, 2015 11:26 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

How to dump kernel route cache in Linux

How to dump kernel route cache in Linux

Linux kernel, as all kernels operates one or more routing tables to find the next hop to a specific destination.
Once it has found one, it keeps a cache entry remembering the MSS for that specific destinations.

There are two ways to dump linux kernel route cache: "route" and iproute2 "ip" command.


"man route" quote:
Quote:
-C operate on the kernel's routing cache.
-n show numerical addresses instead of trying to determine symbolic host names. This is useful if you are trying to determine why the route to your name‐
server has vanished.

-e use netstat(8)-format for displaying the routing table. -ee will generate a very long line with all parameters from the routing table.


Code:
user@linux:~# route -Cen
Kernel IP routing cache
Source          Destination     Gateway         Flags   MSS Window  irtt Iface
10.0.0.1       10.0.0.2       10.0.0.2       il        0 0          0 lo
193.231.100.34  10.0.0.2       10.0.0.2       l         0 0          0 lo
193.231.100.22  10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       213.184.250.101 10.0.0.1              1500 0        488 eth0
10.0.0.2       203.113.7.243   10.0.0.1              1500 0          0 eth0
10.0.0.2       10.2.0.2        10.0.0.1              1500 0          0 eth0
10.0.0.2       10.1.20.2       10.0.0.1              1500 0          0 eth0
10.0.0.2       74.125.190.88   10.0.0.1              1500 0          0 eth0
66.249.67.147   10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       192.168.1.60    10.0.0.1              1500 0         83 eth0
10.0.0.2       10.2.0.2        10.0.0.1              1500 0          0 eth0
10.1.20.2       10.0.0.2       10.0.0.2       l         0 0          0 lo
10.1.20.2       10.0.0.2       10.0.0.2       l         0 0          0 lo
74.125.74.80    10.0.0.2       10.0.0.2       l         0 0          0 lo
127.0.0.1       127.0.0.1       127.0.0.1       l     16436 0          0 lo
10.0.0.2       82.78.227.181   10.0.0.1              1500 0          0 eth0
10.0.0.2       66.249.67.156   10.0.0.1              1500 0          0 eth0
10.0.0.2       180.180.231.227 10.0.0.1              1500 0       2405 eth0
217.69.128.45   10.0.0.2       10.0.0.2       l         0 0          0 lo
66.249.67.60    10.0.0.2       10.0.0.2       l         0 0          0 lo
149.20.58.131   10.0.0.2       10.0.0.2       l         0 0          0 lo
203.113.7.243   10.0.0.2       10.0.0.2       l         0 0          0 lo
172.16.2.2      10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       172.16.2.2      10.0.0.1              1500 0          0 eth0
158.158.240.230 10.0.0.2       10.0.0.2       l         0 0          0 lo
82.78.227.181   10.0.0.2       10.0.0.2       l         0 0          0 lo
66.249.67.44    10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       109.97.222.253  10.0.0.1              1500 0          0 eth0
10.0.0.2       74.125.190.85   10.0.0.1              1500 0          0 eth0
10.0.0.2       82.78.227.181   10.0.0.1              1500 0         20 eth0
213.184.250.101 10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       10.2.0.1        10.0.0.1              1500 0          0 eth0
10.0.0.2       193.110.49.14   10.0.0.1              1500 0        402 eth0
54.82.188.133   10.0.0.2       10.0.0.2       l         0 0          0 lo
54.91.29.190    10.0.0.2       10.0.0.2       l         0 0          0 lo
192.168.1.60    10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       193.231.100.34  10.0.0.1              1500 0          0 eth0
193.110.49.14   10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       74.125.74.80    10.0.0.1              1500 0          0 eth0
127.0.0.1       127.0.0.1       127.0.0.1       l     16436 0         56 lo
74.125.190.85   10.0.0.2       10.0.0.2       l         0 0          0 lo
91.200.12.75    10.0.0.2       10.0.0.2       l         0 0          0 lo
10.0.0.2       193.231.100.22  10.0.0.1              1500 0          0 eth0
10.0.0.2       10.2.0.1        10.0.0.1              1500 0          0 eth0
10.0.0.2       10.1.20.2       10.0.0.1              1500 0          0 eth0
10.0.0.2       66.249.67.147   10.0.0.1              1500 0          0 eth0
10.0.0.2       91.200.12.75    10.0.0.1              1500 0          0 eth0
10.0.0.2       149.20.58.131   10.0.0.1              1500 0          0 eth0
10.0.0.2       54.91.29.190    10.0.0.1              1500 0          0 eth0
66.249.67.156   10.0.0.2       10.0.0.2       l         0 0          0 lo
109.97.222.253  10.0.0.2       10.0.0.2       l         0 0          0 lo
74.125.190.88   10.0.0.2       10.0.0.2       l         0 0          0 lo
10.1.1.54       10.0.0.2       10.0.0.2       l         0 0          0 lo
180.180.231.227 10.0.0.2       10.0.0.2       l         0 0          0 lo

Code:
user@linux:~# ip ro show cache
local 10.0.0.2 from 180.180.231.227 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 10.1.1.54 tos lowdelay dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 74.125.190.88 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 109.97.222.253 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 66.249.67.156 dev lo  src 10.0.0.2
    cache <local>  iif eth0
54.91.29.190 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
149.20.58.131 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0x9d64 mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
91.200.12.75 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
66.249.67.147 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
10.1.20.2 via 10.0.0.1 dev eth0  src 10.0.0.2
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
10.2.0.1 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
193.231.100.22 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0x7188 mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 91.200.12.75 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 74.125.190.85 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 127.0.0.1 from 127.0.0.1 dev lo
    cache <local>  mtu 16436 rtt 125ms rttvar 110ms cwnd 7 advmss 16396 hoplimit 64
74.125.74.80 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0x7a93 mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 193.110.49.14 dev lo  src 10.0.0.2
    cache <local>  iif eth0
193.231.100.34 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0xdb8e mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 192.168.1.60 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 54.91.29.190 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 54.82.188.133 dev lo  src 10.0.0.2
    cache <local>  iif eth0
193.110.49.14 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 rtt 940ms rttvar 770ms cwnd 10 advmss 1460 hoplimit 64 initcwnd 10
10.2.0.1 via 10.0.0.1 dev eth0  src 10.0.0.2
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 213.184.250.101 dev lo  src 10.0.0.2
    cache <local>  iif eth0
82.78.227.181 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 rtt 40ms rttvar 40ms cwnd 10 advmss 1460 hoplimit 64 initcwnd 10
74.125.190.85 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0xa6bb mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
109.97.222.253 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 66.249.67.44 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 82.78.227.181 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 158.158.240.230 dev lo  src 10.0.0.2
    cache <local>  iif eth0
172.16.2.2 via 10.0.0.1 dev eth0  src 10.0.0.2
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 172.16.2.2 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 203.113.7.243 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 149.20.58.131 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 66.249.67.60 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 217.69.128.45 dev lo  src 10.0.0.2
    cache <local>  iif eth0
180.180.231.227 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 rtt 4810ms rttvar 4810ms cwnd 14 advmss 1460 hoplimit 64 initcwnd 10
66.249.67.156 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
82.78.227.181 via 10.0.0.1 dev eth0  src 10.0.0.2
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
local 127.0.0.1 dev lo  src 127.0.0.1
    cache <local>  mtu 16436 advmss 16396 hoplimit 64
local 10.0.0.2 from 74.125.74.80 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 10.1.20.2 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 10.1.20.2 tos throughput dev lo  src 10.0.0.2
    cache <local>  iif eth0
10.2.0.2 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
192.168.1.60 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 rtt 150ms rttvar 170ms cwnd 10 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 66.249.67.147 dev lo  src 10.0.0.2
    cache <local>  iif eth0
74.125.190.88 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0x3bce mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
10.1.20.2 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0xbd82 mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
10.2.0.2 via 10.0.0.1 dev eth0  src 10.0.0.2
    cache  mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
203.113.7.243 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  ipid 0xb883 mtu 1500 advmss 1460 hoplimit 64 initcwnd 10
213.184.250.101 from 10.0.0.2 via 10.0.0.1 dev eth0
    cache  mtu 1500 rtt 1285ms rttvar 900ms ssthresh 5 cwnd 9 advmss 1460 hoplimit 64 initcwnd 10
local 10.0.0.2 from 193.231.100.22 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 193.231.100.34 dev lo  src 10.0.0.2
    cache <local>  iif eth0
local 10.0.0.2 from 10.0.0.1 dev lo  src 10.0.0.2
    cache <local,src-direct>  iif eth0





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "How to dump kernel route cache in Linux"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to add IP alias in Debian Linux to last after reboot

debuser

3

4956

Sat Jul 21, 2012 6:03 am

Harespok View the latest post

There are no new unread posts for this topic. Linux: How to list IPv6 neighbors

mandrei99

0

3854

Thu Oct 09, 2014 3:11 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to add (persistent) static ARP entries in Linux

mandrei99

0

31060

Mon Sep 29, 2014 5:17 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux How to change hardware MAC address of an interface

debuser

1

3599

Tue Dec 06, 2011 6:26 am

Zettie49 View the latest post

There are no new unread posts for this topic. DNS reverse lookup in Windows 7 and Linux using - nslookup

mandrei99

0

5941

Tue Jan 13, 2015 8:31 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Set up FTP PROXY via command line in Linux/FreeBSD

mandrei99

0

22860

Tue Jan 20, 2015 5:01 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Linux adding and removing vlan tagged interfaces

mandrei99

0

35575

Wed Aug 28, 2013 8:19 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux tso (tcp segmentation offload) - what it means and how to enable/disable it

mandrei99

0

51092

Fri Jan 16, 2015 5:41 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux script for interface network bandwidth monitoring

admin

0

3740

Mon Feb 09, 2015 7:05 pm

admin View the latest post

There are no new unread posts for this topic. How to block ping icmp echo requests without a firewall in Linux

debuser

0

2781

Mon Nov 26, 2012 9:46 am

debuser View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO