Thursday, July 17, 2008

Understanding routing table flags

Following command produces very handy routing table of your system.

#netstat -r
#route

The output is very handy and helps in troubleshooting your network problem. The flags if you can understand will help you much more. So here is the summary of the flags and their meaning.

Flag

Name

Meaning



1

RTF_PROTO1

Protocol specific routing flag 1

2

RTF_PROTO2

Protocol specific routing flag 2

3

RTF_PROTO3

Protocol specific routing flag 3

B

RTF_BLACKHOLE

Just discard pkts (during updates)

b

RTF_BROADCAST

The route represents a broadcast address

C

RTF_CLONING

Generate new routes on use

c

RTF_PRCLONING

Protocol-specified generate new routes on use

D

RTF_DYNAMIC

Created dynamically (by redirect)

G

RTF_GATEWAY

Destination requires forwarding by intermediary

H

RTF_HOST

Host entry (net otherwise)

L

RTF_LLINFO

Valid protocol to link address translation

M

RTF_MODIFIED

Modified dynamically (by redirect)

R

RTF_REJECT

Host or net unreachable

S

RTF_STATIC

Manually added

U

RTF_UP

Route usable

W

RTF_WASCLONED

Route was generated as a result of cloning

X

RTF_XRESOLVE

External daemon translates proto to link address

3 comments:

  1. I have not been able to find the O flag documented(capital alpha O )
    the following flags are set for the route: UO

    I also don't understand the C flag (Capital). What does it mean "generate new route on use" ? what actually happens?

    Thanks!

    ReplyDelete
  2. Google:

    RTF_CLONING is set when the route is added (either manually, or
    automatically for interface routes) to indicate that a more specific
    route (possibly a host route) needs to be generated on every unique
    lookup.

    Regarding the capital O I'll see if I can generate it somehow. Please wait when I have some free time.

    ReplyDelete
  3. What mean the Flag A?

    ReplyDelete