Command Line Reference
IP Unicast Routing
Route Map
58 min
show route map show route map \[command] show route map word \[purpose] display data about each daemons knowledge of individual route maps \[parameter] parameter description word route map name \[view] system view \[use cases] sonic# show route map clear route map counters clear route map counters \[command] clear route map counters word \[purpose] clear counters that are being stored about the route map utilization so that subsuquent show commands will indicate since the last clear \[parameter] parameter description word route map name \[view] system view \[use cases] sonic# clear route map counters show ip prefix list show ip prefix list \[command] show ip prefix list {detail|summary| name } \[purpose] display the ip prefix list \[view] system view \[use cases] sonic# show ip prefix list summary prefix list with the last deletion/insertion test zebra ip prefix list test count 1, range entries 0, sequences 1 1 prefix list with the last deletion/insertion test ospf ip prefix list test count 1, range entries 0, sequences 1 1 prefix list with the last deletion/insertion test bgp ip prefix list test count 1, range entries 0, sequences 1 1 prefix list with the last deletion/insertion test isis ip prefix list test count 1, range entries 0, sequences 1 1 bgp as path access list bgp as path access list \[command] bgp as path access list word {permit|deny} line no bgp as path access list word {permit|deny} line \[purpose] configure route filtering policies based on as path lists \[parameter] parameter description word access list name line regular expression (1234567890 ^|\[, {}() ]$ + ? \\) to match the bgp as paths \[view] system configuration view \[use cases] sonic# configure terminal sonic(config)# bgp as path access list s permit 66 bgp large community list bgp large community list \[command] bgp large community list {standard|expanded} name {permit|deny} large community no bgp large community list {standard|expanded} name {permit|deny} large community \[purpose] this command defines a new standard large community list \[parameter] parameter description standard standard community list expanded expanded community list name community list name large community large community in 'aa\ bb\ cc' format \[view] system configuration view \[notes] when filtering bgp large community attributes, you can configure multiple filter criteria within the same entry the relationship between filter criteria is "and," which means all filter criteria must be matched for the rule to be considered a match for example, with the command " bgp large community list standard test 10 permit 100 1 1 200 1 1 300 1 1," the rule will be considered a match only when all three large community values (100 1 1, 200 1 1, and 300 1 1) are simultaneously present within a single list, multiple rules have an "or" relationship for example, with the commands " bgp large community list standard test 10 permit 100 1 1" and "bgp large community list standard test 20 permit 200 1 1," when searching for rules within the "test" group, matching either 100 1 1 or 200 1 1 will be considered a match \[use cases] sonic# configure terminal sonic(config)# bgp large community list standard as permit aa\ bb\ cc route map route map \[command] route map word {permit|deny} order no route map word {permit|deny} order \[purpose] configure the order’th entry in route map name with match policy of either permit or deny \[parameter] parameter description word route map name order sequence to insert to/delete from existing route map entry (1 65535) \[notes] this command unconfigures the order entry in the routing table name \[view] system configuration view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 ip prefix ip prefix \[command] ip prefix name no ip prefix name \[ seq number ] {permit|deny} {any| a b c d/m {ge|le} length } \[purpose] configures an ip prefix list or one entry in the ip prefix list \[parameter] parameter description name specifies the name of an ip prefix list number specifies the sequence number of the entry in the ip prefix list the value is an integer ranging from 1 to 4294967295, by default, the sequence number increases with a step of 5 according to the configuration order, and the first number is 1 permit specifies the matching mode of the ip prefix list as permit in permit mode, if the ip address to be filtered is in the defined prefix range, the ip address matches the route policy and no longer matches against the next entry otherwise, the ip address continues to match against the next entry deny specifies the matching mode of the ip prefix list as deny in deny mode, if the ip address to be filtered is in the defined prefix range, the ip address fails to match the route policy and cannot match against the next entry otherwise, the ip address continues to match against the next entry any all ip address a b c d/ specifies the ip address ge length specifies the minimum value of the mask length range le length specifies the maximum value of the mask length range \[notes] an ip prefix list can be used as a filter or as filtering conditions of a route map the matching principle of table entries in the address prefix list is match according to the ordinal id from smallest to largest, and no other table entries will be matched after the filtered route hits a certain table entry, and the route that cannot match any table entry is deemed to have failed the filter and will not enter any subsequent processing \[view] system config view \[use cases] sonic(config)# ip prefix list test permit 1 1 1 0/24 ge 32 match {ip|ipv6} address match {ip|ipv6} address \[command] match {ip|ipv6} address {prefix len length |prefix list prefix list name } no match {ip|ipv6} address {prefix len length |prefix list prefix list name } \[purpose] matches the specified prefix list \[parameter] parameter description length match prefix length of ip address prefix list name match entries of prefix lists \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match ip address prefix list test match {ip|ipv6} next hop match {ip|ipv6} next hop \[command] match {ip|ipv6} next hop {prefix len length |prefix list prefix list name |address{ a b c d | x\ x x \ x }|type blackhole} no match {ip|ipv6} next hop {prefix len length |prefix list prefix listname |address{ a b c d | x\ x x \ x }|type blackhole} \[purpose] match the next hop \[parameter] parameter description length match prefix length of ip address prefix list name match entries of prefix lists a b c d ip address of next hop x\ x x \ x ipv6 address of next hop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match ip next hop type blackhole match as path match as path \[command] match as path string no match as path string \[purpose] matches the specified as path \[parameter] parameter description string as path access list name \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match as path test match metric match metric \[command] match metric metric no match metric metric \[purpose] matches the specified metric \[parameter] parameter description metric value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match metric 12 match tag match tag \[command] match tag tag no match tag tag \[purpose] matches the specified tag value associated with the route \[parameter] parameter description tag tag value (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match tag 12 match local preference match local preference \[command] match local preference metric no match local preference metric \[purpose] matches the specified local preference \[parameter] parameter description metric metric value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match local preference 12 match community match community \[command] match community community list no math community community list \[purpose] matches the specified community list \[parameter] parameter description community list community list name \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match community test match peer match peer \[command] match peer { a b c d | x\ x x \ x | interace name } no match peer { a b c d | x\ x x \ x | interace name } \[purpose] this is a bgp specific match command matches the peer ipv6 address if the neighbor was specified in this manner \[parameter] parameter description a b c d ip address of peer x\ x x \ x ipv6 address of peer interace name interface name of peer \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match peer 1 1 1 1 match peer local match peer local \[command] match peer local no match peer local \[purpose] matches the peer static or redistributed routes \[notes] this command unmatches peer to peer static or redistributed routes \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match peer local match source protocol match source protocol \[command] match source protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric} no match source protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric} \[purpose] this is a zebra specific match command matches the originating protocol specified \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match source protocol static l match source instance match source instance \[command] match source instance instance no match source instance instance \[purpose] this is a zebra specific match command \[parameter] parameter description instance the instance number (0 255) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match source instance 2 set tag set tag \[command] set tag tag no set tag tag \[purpose] set a tag on the matched route \[parameter] parameter description tag tag value (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set tag 12 set ip next hop set ip next hop \[command] set ip next hop a b c d no set ip next hop a b c d \[purpose] set the bgp nexthop address \[parameter] parameter description a b c d ip address \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ip next hop 1 1 1 1 set ip next hop peer address set ip next hop peer address \[command] set ip next hop peer address no set ip next hop peer address \[purpose] set the bgp nexthop address to the address of the peer \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ip next hop peer address set ip next hop unchanged set ip next hop unchanged \[command] set ip next hop unchanged no set ip next hop unchanged \[purpose] set the route map as unchanged \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ip next hop unchanged set ipv6 next hop peer address set ipv6 next hop peer address \[command] set ipv6 next hop peer address no set ipv6 next hop peer address \[purpose] set the bgp nexthop address to the address of the peer \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop peer address set ipv6 next hop prefer global set ipv6 next hop prefer global \[command] set ipv6 next hop prefer global no set ipv6 next hop prefer global \[purpose] for incoming and import route maps if we receive a v6 global and v6 ll address for the route, then prefer to use the global address as the nexthop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop prefer global set ipv6 next hop global set ipv6 next hop global \[command] set ipv6 next hop global x\ x x \ x no set ipv6 next hop global x\ x x \ x \[purpose] set the next hop to the specified ipv6 address for both incoming and outgoing route maps \[parameter] parameter description x\ x x \ x ipv6 address of next hop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop global 100 1 set ipv6 next hop local set ipv6 next hop local \[command] set ipv6 next hop local x\ x x \ x no set ipv6 next hop local x\ x x \ x \[purpose] set the bgp 4+ link local ipv6 nexthop address \[parameter] parameter description x\ x x \ x ipv6 address of next hop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop local 100 1 set local preference set local preference \[command] set local preference preference no set local preference preference \[purpose] subtract the bgp local preference \[parameter] parameter description preference preference value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set local preference 12 set distance set distance \[command] set distance distance no set distance distance \[purpose] set the administrative distance \[parameter] parameter description distance distance value (0 255) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set distance 12 set weight set weight \[command] set weight weight no set weight weight \[purpose] set the route’s weight \[parameter] parameter description weight value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set weight 12 set metric set metric \[command] set metric { metric |rtt|+rtt| rtt>} no set metric { metric |rtt|+rtt| rtt>} \[purpose] set the bgp attribute med to a specific value \[parameter] parameter description metric 2147483647 2147483647 \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set metric 12 set as path prepend set as path prepend \[command] set as path prepend \[ as path ] \[ last as number ] no set as path prepend \[ as path ] \[ last as number ] \[purpose] set the bgp as path to prepend \[parameter] parameter description as path as number (1 4294967295) number number of times to insert (1 10) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set as path prepend 12 set as path exclude set as path exclude \[command] set as path exclude \[ as number ] no set as path exclude \[ as number ] \[purpose] drop as number from the bgp as path \[parameter] parameter description as number as number (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set as path exclude 12 set community set community \[command] set community \[ community ] no set community \[ community ] \[purpose] set the bgp community attribute \[parameter] parameter description community community number in aa\ nn format (where aa and nn are (0 65535)) or local as \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set community 12 set origin {egp|igp|incomplete} set origin {egp|igp|incomplete} \[command] set origin {egp|igp|incomplete} no set origin {egp|igp|incomplete} \[purpose] set bgp route origin \[notes] this command cancels the bgp route origin setting \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set origin igp set table set table \[command] set table tableid no set table tableid \[purpose] set the bgp table to a given table identifier \[parameter] parameter description tableid kernel routing table id (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set table 12 set sr te color set sr te color \[command] set sr te color color no set sr te color color \[purpose] set the color of a sr te policy to be applied to a learned route \[parameter] parameter description color color of the sr te policies to match with (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set sr te color 12 on match on match \[command] on match {goto number |next} no on match {goto number |next} \[purpose] proceed on to the next entry in the route map \[parameter] parameter description number number (1 65535) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# on match next set src set src \[command] set src ip address \[purpose] set the preferred source address for matching routes when installing in the kernel \[parameter] parameter description ip address ipv4/ipv6 address \[view] route map view \[use cases] sonic(config)# route map rm set src permit 10 sonic(config route map)# set src 30 11 0 48 ip protocol ip protocol \[command] ip protocol protocol route map routemap \[purpose] filter which routes will install in the kernel \[parameter] parameter description protocol kernel/connected/static/rip/ospf/isis/bgp/any routemap router map name \[view] system configuration view \[use cases] sonic(config)# ip protocol bgp route map rm set src
