0

I'm trying to get the routing rules for a specific IP but the ip rule command throws an error. Shouldn't this work like the add/del etc. ? At least that seems to me from the docs.

$ ip rule list 192.168.1.100
"ip rule show" does not take any arguments.

Doc:

$ ip rule help
Usage: ip rule [ list | add | del | flush ] SELECTOR ACTION
SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]
            [ iif STRING ] [ oif STRING ] [ pref NUMBER ]
ACTION := [ table TABLE_ID ]
          [ prohibit | reject | unreachable ]
          [ realms [SRCREALM/]DSTREALM ]
          [ goto NUMBER ]
          SUPPRESSOR
SUPPRESSOR := [ suppress_prefixlength NUMBER ]
              [ suppress_ifgroup DEVGROUP ]
TABLE_ID := [ local | main | default | NUMBER ]
2

Apparently it takes no arguments. Explicitly documented in the manpage.

ip rule show - list rules

This command has no arguments. The options list or lst are synonyms with show.

2
  • I might have misread the doc but isn't ip rule [ list | add | del | flush ] SELECTOR ACTION means that list , add, del and flush takes a SELECTOR and ACTION ? How does this syntax say that list takes no argument but add does? Jul 5 '15 at 7:30
  • @AnthonyHunt Agreed. How about sending a patch to correct this help to the upstream?
    – yaegashi
    Jul 5 '15 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.