понедельник, 6 октября 2014 г.

Configured Routes. Aggregated, Generated, Martians.

Static Routes


A static route within the JUNOS software is a route to a destination with an assigned next hop.
If we want to place the route into the routing table, the next hop must be valid. This means that the router is able to forward packets using the next hop.

Иерархический концепт

routing-options {
   static {
      defaults {
         static-options;
      }
      route destination-prefix {
         next-hop next-hop;
         qualified-next-hop address {
            metric metric;
            preference preference;
         }
         lsp-next-hop lsp-name {
            metric metric;
            preference preference;
         }
         static-options;
      }
   }
}





              Next-Hop Options

Directly connected IP address
An IP address belonging to a physically connected subnet is often used as the next hop for a static route. The interface connected to the remote router is used to forward user packets.

Remote IP address
You can also use any known IP address in the network as a next hop. The local router performs a
recursive lookup in the inet.0 routing table to find a physical next hop to the configured address. You enable this functionality by adding the resolve keyword when defining the IP address.

reject
The value reject is a configured null value. Route lookups that match a static route with a reject next hop are dropped.
А вот так яснее: Drop packets to destination; send ICMP unreachables

discard
The value discard is also a configured null value. Route lookups matching this nexthop value are also dropped.
А вот так яснее: Drop packets to destination; send no ICMP unreachables


Qualified next hop
Routes utilizing a qualified next hop allow you to assign multiple IP address next hops and/or JUNOS software preference values to a single static route. This enables multiple versions of the same prefix to appear in the routing table at the same time. In effect, you end up with a floating static route

Label switched path (LSP)
In a network configured to use Multiprotocol Label Switching (MPLS), a static route can be assigned an LSP as a next-hop value. All route lookups matching this next hop are forwarded using a label value instead of an IP address.

     
           Static Route Attributes

active
This option tells the router to remove the route from the routing table if the next hop becomes unavailable; it is the default value for static routes.

as-path
This option manually assigns the AS Path attribute to a static route and is useful when the route is redistributed into BGP.

community
This option assigns a BGP community value to the route. It is also helpful when you’re performing route redistribution.

install
This option places usable static routes into the forwarding table on the Packet Forwarding Engine; it is the default value for static routes.

metric
With this option, metric values assigned to static routes are used by the Routing Engine to select which version of a route to use.

no-install
This option is the opposite of the install option. A static route with this attribute will not be placed into the forwarding table on the router.

no-readvertise
This option prevents a static route from being exported from the routing table and redistributed into another routing protocol using a routing policy.

no-retain
With this option, static routes are removed from the forwarding table if the routing process shuts down. This value is the default for static routes. passive The opposite of active, the passive option allows a static route to stay in the routing table if the next hop is unavailable.

preference 
This option allows a static route to have a preference value other than the default of 5. Preference values are covered in the “JUNOS software Preference Values” section later in this chapter.

readvertise 
The opposite of no-readvertise, this option allows a static route to be exported from the routing table and redistributed into another routing protocol. This value is the default for static routes.

retain 
Routes configured with this option (the opposite of no-retain) will remain in the forwarding table if the routing process shuts down. This option helps to speed the start time of a router when a large number of static routes are configured.


          Configuration Examples

[edit routing-options]
user@Chardonnay# set static route 192.168.16/24 next-hop 1.1.1.1


[edit routing-options]
user@Chardonnay# show
   static {
      route 192.168.16.0/24 next-hop 1.1.1.1;
   }


user@Chardonnay> show route protocol static
inet.0: 13 destinations, 15 routes (13 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both


192.168.16.0/24 *[Static/5] 00:03:58
> to 1.1.1.1 via fe-0/0/0.0


192.168.32.0/24 *[Static/5] 00:01:14
> to 1.1.1.1 via fe-0/0/0.0


192.168.48.0/24 *[Static/5] 00:01:14
> to 1.1.1.1 via fe-0/0/0.0
Изменение default-preference, желательно руками не трогать

[edit routing-options]
user@Chardonnay# set static defaults preference 200



Aggregated Routes


Суть в чём, после того как они введены в unit.0 в систему, они исчезнут только после того как их удалят вручную. Помогают сэкономить время обработки маршрутов в какой-то мере, по сути являясь summary-route. Заметим, что при обработке маршрута Aggregate route  рассматривается как destination и применяется к пакету именно в таком аспекте. Служит для обработки пакетов входящих в рейндж Aggregated, но не совпадающих с его Сontributed routes, с возможность. сделать для этих пакетов reject либо discard перед тем как его дропнуть.

Aggregated Preference -- 130, соответственно они будут обрабатываться после статических и IGP маршрутов, если более подходящего маршрута среди них не будет найдено.

Сontributing routes -- маршруты логически входящие в рейндж Aggregated Routes

user@Chardonnay> show route protocol aggregate detail
inet.0: 23 destinations, 25 routes (23 active, 0 holddown, 0 hidden) 192.168.0.0/17 (1 entry, 1 announced)
    *Aggregate Preference: 130
        Next hop type: Reject
        State: <Active Int Ext>
        Age: 23
        Task: Aggregate
        Announcement bits (2): 0-KRT 5-Resolve inet.0
        AS path: I (LocalAgg)
        Flags: Depth: 0 Active
        AS path list:
        AS path: I Refcount: 3
                Contributing Routes (3):
            192.168.16.0/24 proto Static
            192.168.32.0/24 proto Static
            192.168.48.0/24 proto Static

          Next-Hop Options

reject
The value reject is a configured null value. Route lookups that match an aggregate route with a reject next hop are dropped and an ICMP “Destination Host Unreachable” message is returned to the source of the packet. This is the default for aggregate routes.

discard 
The value discard is also a configured null value. Route lookups matching this next-hop value are also dropped.


        Aggregate Route Attributes


routing-options {
    aggregate {
        defaults {
            aggregate-options;
        }
        route destination-prefix {
            policy policy-name;
            aggregate-options;
        }
    }
}

active 
This option tells the router to remove the route from the routing table if all contributing routes become unavailable. This value is the default for aggregate routes.

as-path 
This option manually assigns the AS Path attribute and is useful when the route is redistributed into  BGP. With this option, only the longest common sequences in the AS Path of all  BGP contributing routes are transferred to the aggregate.

community 
This option assigns a BGP community value to the route and is also helpful when you’re performing route redistribution. full With this option, all AS values in the AS Path of BGP contributing routes are included in the aggregate. This value is the default for aggregate routes.

metric 
With this option, metric values are assigned to allow the Routing Engine to select which version of a route to use when the route preference values are equal. To learn more about the selection of active routes in the routing table.

passive 
The opposite of active, the passive option will allow the route to stay in the routing table if no contributing routes are available.

policy 
By default, all possible contributing routes to an aggregate will in fact contribute. A routing policy is defined to allow only certain contributing routes to contribute to an aggregate.

preference 
This option allows an aggregate route to have a preference value other than the default of 130.

Example:

[edit routing-options]
user@Chardonnay# set aggregate route 192.168/17


[edit routing-options]
user@Chardonnay# show
     aggregate {
         route 192.168.0.0/17;
     }


Generated Routes

A generated route is identical to an aggregate route in all but one way. Both forms of routes summarize routes, rely on contributing routes, and share most attribute values. In fact, the routing table views them as one protocol, protocol aggregate. The one difference between them is in the default next-hop attribute. Recall that an aggregate has a default next hop of reject with an option for discard. A generated route, on the other hand, has an IP address as its default next hop with an option for discard. With these two routes being mainly equal, we’ll skip the listing of next-hop and attribute options.
По простому, он работает так же как и aggregate, но в агрегацию не включает маршруты с параметрами next-hop: reject и discard. Просто как паровоз.

Дальше чуть сложнее
Unlike aggregate routes, the next hop associated with a generated route is the same next hop as that of the primary contributing route. The primary contributing route is the route with lowest route preference that falls within the aggregated range of prefixes. If there are multiple routes that fall within the aggregated range that share the same route preference, the route with the lowest number prefix, not the lowest prefix length, is selected as the primary contributing route.
Т.е. например:
172.29.0.0/24
172.29.1.0/24
172.29.2.0/24

172.29.0.0/25
172.29.1.0/24
172.29.2.0/24

172.29.0.0/23
172.29.1.0/24
172.29.2.0/24

для next-hop будет выбран next-hop маршрута 172.29.0.0 независимо от его префикса, т.е.
lowest number prefix (172.29.0.0),  not the lowest prefix length (/24, /23, /25)


          Contributing Routes

A generated route needs at least one contributing route in the routing table to become active. These contributing routes, however, must either include an IP address for a next hop or be a connected point-to-point interface. Next-hop values of discard or reject on a route makes the route ineligible to contribute.

Example:

user@Riesling> show route 192.168/16
inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden) 

+ = Active Route, - = Last Active, * = Both

192.168.16.0/24 *[IS-IS/18] 00:16:27, metric 20, tag 2
> to 3.3.3.2 via fe-0/0/2.0
192.168.32.12/30 *[Static/5] 00:32:46
Reject

192.168.32.24/30 *[Static/5] 00:32:46
> to 10.10.10.1 via so-0/1/1.0
192.168.32.36/30 *[Static/5] 00:32:46
Discard

192.168.32.48/30 *[Static/5] 00:32:46
> to 10.10.10.1 via so-0/1/1.0
192.168.48.0/24 *[IS-IS/18] 00:11:04, metric 20, tag 2
> to 2.2.2.2 via fe-0/0/1.0


[edit routing-options]
user@Riesling# set generate route 192.168/16


user@Riesling> show route 192.168/16
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both


192.168.0.0/16 *[Aggregate/130] 00:01:15
> to 3.3.3.2 via fe-0/0/2.0

192.168.16.0/24 *[IS-IS/18] 00:17:42, metric 20, tag 2
> to 3.3.3.2 via fe-0/0/2.0
192.168.32.12/30 *[Static/5] 00:34:01
Reject

192.168.32.24/30 *[Static/5] 00:34:01
> to 10.10.10.1 via so-0/1/1.0
192.168.32.36/30 *[Static/5] 00:34:01
Discard

192.168.32.48/30 *[Static/5] 00:34:01
> to 10.10.10.1 via so-0/1/1.0
192.168.48.0/24 *[IS-IS/18] 00:12:19, metric 20, tag 2
> to 2.2.2.2 via fe-0/0/1.0


user@Riesling> show route protocol aggregate detail
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
192.168.0.0/16 (1 entry, 1 announced)
      *Aggregate Preference: 130
            Nexthop: 3.3.3.2 via fe-0/0/2.0, selected
            State: <Active Int Ext>
            Age: 2
            Task: Aggregate
            Announcement bits (2): 0-KRT 5-Resolve inet.0
            AS path: I (LocalAgg)
            Flags: Depth: 0 Active
            AS path list:
            AS path: I Refcount: 4
            Contributing Routes (4):
                        192.168.16.0/24 proto IS-IS
                        192.168.32.24/30 proto Static
                        192.168.32.48/30 proto Static
                        192.168.48.0/24 proto IS-IS

Как видим reject и discard маршруты были исключены из аггрегации.



Martian Routes

Prefix bits of 0.0.0.0 /8 were reserved by IANA in September 1981.
Prefix bits of 127.0.0.0 /8 were reserved by IANA in September 1981.
Prefix bits of 128.0.0.0 /16 are used by various address registries and were reserved in May 1993.
Prefix bits of 191.255.0.0 /16 are used by various address registries and were reserved in May 1993.
Prefix bits of 192.0.0.0 /24 are used by various regional address registries and were reserved in May 1993.
Prefix bits of 223.255.255.0 /24 were reserved by IANA in September 1981.
Prefix bits of 240.0.0.0 /4 denote the traditional Class E address space and are used only for experimental purposes.



Комментариев нет:

Отправить комментарий