Skip to content

ルータのコントロールプレーンの保護について書かれたドキュメントが RFC 化されました。

基本的なポイントは以下のようです。

  1. コントロールプレーン宛のトラフィックを許可するアドレスを ACL で制限する
  2. コントロールプレーン宛の ICMP トラフィックは、流量を制限する
  3. フラグメント化されたコントロールプレーン宛のトラフィックは拒否する

Appendix には Cisco や Juniper での設定例も記載されていますので、引用しておきます。

Cisco(IOS)での設定例

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
!Start: Protecting The Router Control Plane
   !
   !Control Plane Policing (CoPP) Configuration
   !
   !Access Control List Definitions
   !
   ip access-list extended ICMP
    permit icmp any any
   ipv6 access-list ICMPv6
    permit icmp any any
   ip access-list extended OSPF
    permit ospf 192.0.2.0 0.0.0.255 any
   ipv6 access-list OSPFv3
    permit 89 FE80::/10 any
   ip access-list extended IBGP
    permit tcp 192.0.2.0 0.0.0.255 eq bgp any
    permit tcp 192.0.2.0 0.0.0.255 any eq bgp
   ipv6 access-list IBGPv6
    permit tcp 2001:DB8:1::/48 eq bgp any
    permit tcp 2001:DB8:1::/48 any eq bgp
   ip access-list extended EBGP
    permit tcp host 198.51.100.25 eq bgp any
    permit tcp host 198.51.100.25 any eq bgp
    permit tcp host 198.51.100.27 eq bgp any
    permit tcp host 198.51.100.27 any eq bgp
    permit tcp host 198.51.100.29 eq bgp any
    permit tcp host 198.51.100.29 any eq bgp
    permit tcp host 198.51.100.31 eq bgp any
    permit tcp host 198.51.100.31 any eq bgp
   ipv6 access-list EBGPv6
    permit tcp host 2001:DB8:100::25 eq bgp any
    permit tcp host 2001:DB8:100::25 any eq bgp
    permit tcp host 2001:DB8:100::27 eq bgp any
    permit tcp host 2001:DB8:100::27 any eq bgp
    permit tcp host 2001:DB8:100::29 eq bgp any
    permit tcp host 2001:DB8:100::29 any eq bgp
    permit tcp host 2001:DB8:100::31 eq bgp any
    permit tcp host 2001:DB8:100::31 any eq bgp
   ip access-list extended DNS
    permit udp 198.51.100.0 0.0.0.252 eq domain any
   ipv6 access-list DNSv6
    permit udp 2001:DB8:100:1::/64 eq domain any
    permit tcp 2001:DB8:100:1::/64 eq domain any
   ip access-list extended NTP
    permit udp 198.51.100.4 255.255.255.252 any eq ntp
   ipv6 access-list NTPv6
    permit udp 2001:DB8:100:2::/64 any eq ntp
   ip access-list extended SSH
    permit tcp 198.51.100.128 0.0.0.128 any eq 22
   ipv6 access-list SSHv6
    permit tcp 2001:DB8:100:3::/64 any eq 22
   ip access-list extended SNMP
    permit udp 198.51.100.128 0.0.0.128 any eq snmp
   ipv6 access-list SNMPv6
    permit udp 2001:DB8:100:3::/64 any eq snmp
   ip access-list extended RADIUS
    permit udp host 198.51.100.9 eq 1812 any
    permit udp host 198.51.100.9 eq 1813 any
    permit udp host 198.51.100.10 eq 1812 any
    permit udp host 198.51.100.10 eq 1813 any
   ipv6 access-list RADIUSv6
    permit udp host 2001:DB8:100::9 eq 1812 any
    permit udp host 2001:DB8:100::9 eq 1813 any
    permit udp host 2001:DB8:100::10 eq 1812 any
    permit udp host 2001:DB8:100::10 eq 1813 any
   ip access-list extended FRAGMENTS
    permit ip any any fragments
   ipv6 access-list FRAGMENTSv6
    permit ipv6 any any fragments
   ip access-list extended ALLOTHERIP
    permit ip any any
   ipv6 access-list ALLOTHERIPv6
    permit ipv6 any any
   !
   !Class Definitions
   !
   class-map match-any ICMP
    match access-group name ICMP
   class-map match-any ICMPv6
    match access-group name ICMPv6
   class-map match-any OSPF
    match access-group name OSPF
    match access-group name OSPFv3
   class-map match-any IBGP
    match access-group name IBGP
    match access-group name IBGPv6
   class-map match-any EBGP
    match access-group name EBGP
    match access-group name EBGPv6
   class-map match-any DNS
    match access-group name DNS
    match access-group name DNSv6
   class-map match-any NTP
    match access-group name NTP
    match access-group name NTPv6
   class-map match-any SSH
    match access-group name SSH
    match access-group name SSHv6
   class-map match-any SNMP
    match access-group name SNMP
    match access-group name SNMPv6
   class-map match-any RADIUS
    match access-group name RADIUS
    match access-group name RADIUSv6
   class-map match-any FRAGMENTS
    match access-group name FRAGMENTS
    match access-group name FRAGMENTSv6
   class-map match-any ALLOTHERIP
    match access-group name ALLOTHERIP
   class-map match-any ALLOTHERIPv6
    match access-group name ALLOTHERIPv6
   !
   !Policy Definition
   !
   policy-map COPP
    class FRAGMENTS
     drop
    class ICMP
     police 500000
        conform-action transmit
        exceed-action drop
        violate-action drop
    class ICMPv6
     police 500000
        conform-action transmit
        exceed-action drop
        violate-action drop
    class OSPF
    class IBGP
    class EBGP
    class DNS
    class NTP
    class SSH
    class SNMP
    class RADIUS
    class ALLOTHERIP
      police cir 500000
        conform-action transmit
        exceed-action drop
        violate-action drop
    class ALLOTHERIPv6
      police cir 500000
        conform-action transmit
        exceed-action drop
        violate-action drop
    class class-default
      police cir 250000
        conform-action transmit
        exceed-action drop
        violate-action drop
   !
   !Control Plane Configuration
   !
   control-plane
    service-policy input COPP
   !
   !End: Protecting The Router Control Plane

Juniper(JUNOS)での設定例

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
policy-options {
       prefix-list IBGP-NEIGHBORS {
           192.0.2.0/24;
       }
       prefix-list EBGP-NEIGHBORS {
           198.51.100.25/32;
           198.51.100.27/32;
           198.51.100.29/32;
           198.51.100.31/32;
       }
       prefix-list RADIUS-SERVERS {
           198.51.100.9/32;
           198.51.100.10/32;
       }
       prefix-list IBGPv6-NEIGHBORS {
           2001:DB8:1::/48;
       }
       prefix-list EBGPv6-NEIGHBORS {
           2001:DB8:100::25/128;
           2001:DB8:100::27/128;
           2001:DB8:100::29/128;
           2001:DB8:100::31/128;
       }
       prefix-list RADIUSv6-SERVERS {
           2001:DB8:100::9/128;
           2001:DB8:100::10/128;
       }
   }
   firewall {
       policer 500kbps {
           if-exceeding {
               bandwidth-limit 500k;
               burst-size-limit 1500;
           }
           then discard;
       }
       policer 250kbps {
           if-exceeding {
               bandwidth-limit 250k;
               burst-size-limit 1500;
           }
           then discard;
       }
       family inet {
           filter protect-router-control-plane {
               term first-frag {
                   from {
                       first-fragment;
                   }
                   then {
                       count frag-discards;
                       log;
                       discard;
                   }
               }
               term next-frag {
                   from {
                       is-fragment;
                   }
                   then {
                       count frag-discards;
                       log;
                       discard;
                   }
               }
               term icmp {
                   from {
                       protocol icmp;
                   }
                   then {
                       policer 500kbps;
                       accept;
                   }
               }
               term ospf {
                   from {
                       source-address {
                           192.0.2.0/24;
                       }
                       protocol ospf;
                   }
                   then accept;
               }
               term ibgp-connect {
                   from {
                       source-prefix-list {
                           IBGP-NEIGHBORS;
                       }
                       protocol tcp;
                       destination-port bgp;
                   }
                   then accept;
               }
               term ibgp-reply {
                   from {
                       source-prefix-list {
                           IBGP-NEIGHBORS;
                       }
                       protocol tcp;
                       port bgp;
                   }
                   then accept;
               }
               term ebgp-connect {
                   from {
                       source-prefix-list {
                           EBGP-NEIGHBORS;
                       }
                       protocol tcp;
                       destination-port bgp;
                   }
                   then accept;
               }
               term ebgp-reply {
                   from {
                       source-prefix-list {
                           EBGP-NEIGHBORS;
                       }
                       protocol tcp;
                       port bgp;
                   }
                   then accept;
               }
               term dns {
                   from {
                       source-address {
                           198.51.100.0/30;
                       }
                       protocol udp;
                       port domain;
                   }
                   then accept;
               }
               term ntp {
                   from {
                       source-address {
                           198.51.100.4/30;
                       }
                       protocol udp;
                       destination-port ntp;
                   }
                   then accept;
               }
               term ssh {
                   from {
                       source-address {
                           198.51.100.128/25;
                       }
                       protocol tcp;
                       destination-port ssh;
                   }
                   then accept;
               }
               term snmp {
                   from {
                       source-address {
                           198.51.100.128/25;
                       }
                       protocol udp;
                       destination-port snmp;
                   }
                   then accept;
               }
               term radius {
                   from {
                       source-prefix-list {
                           RADIUS-SERVERS;
                       }
                       protocol udp;
                       port [ 1812 1813 ];
                   }
                   then accept;
               }
               term default-term {
                   then {
                       count copp-exceptions;
                       log;
                       policer 500kbps;
                       accept;
                   }
               }
           }
       }

       family inet6 {
           filter protect-router-control-plane-v6 {
               term fragv6 {
                   from {
                       next-header fragment;
                   }
                   then {
                       count frag-v6-discards;
                       log;
                       discard;
                   }
               }
               term icmpv6 {
                   from {
                       next-header icmpv6;
                   }
                   then {
                       policer 500kbps;
                       accept;
                   }
               }
               term ospfv3 {
                   from {
                       source-address {
                           FE80::/10;
                       }
                       next-header ospf;
                   }
                   then accept;
               }
               term ibgpv6-connect {
                   from {
                       source-prefix-list {
                           IBGPv6-NEIGHBORS;
                       }
                       next-header tcp;
                       destination-port bgp;
                   }
                   then accept;
               }
               term ibgpv6-reply {
                   from {
                       source-prefix-list {
                           IBGPv6-NEIGHBORS;
                       }
                       next-header tcp;
                       port bgp;
                   }
                   then accept;
               }
               term ebgpv6-connect {
                   from {
                       source-prefix-list {
                           EBGPv6-NEIGHBORS;
                       }
                       next-header tcp;
                       destination-port bgp;
                   }
                   then accept;
               }
               term ebgpv6-reply {
                   from {
                       source-prefix-list {
                           EBGPv6-NEIGHBORS;
                       }
                       next-header tcp;
                       port bgp;
                   }
                   then accept;
               }
               term dnsv6 {
                   from {
                       source-address {
                          2001:DB8:100:1::/64;
                          }
                       next-header [ udp tcp ];
                       port domain;
                   }
                   then accept;
               }
               term ntpv6 {
                   from {
                       source-address {
                           2001:DB8:100:2::/64;
                       }
                       next-header udp;
                       destination-port ntp;
                   }
                   then accept;
               }
               term sshv6 {
                   from {
                       source-address {
                           2001:DB8:100:3::/64;
                       }
                       next-header tcp;
                       destination-port ssh;
                   }
                   then accept;
               }
               term snmpv6 {
                   from {
                       source-address {
                           2001:DB8:100:3::/64;
                       }
                       next-header udp;
                       destination-port snmp;
                   }
                   then accept;
               }
               term radiusv6 {
                   from {
                       source-prefix-list {
                           RADIUSv6-SERVERS;
                       }
                       next-header udp;
                       port [ 1812 1813 ];
                   }
                   then accept;
               }
               term default-term-v6 {
                   then {
                       policer 500kbps;
                       count copp-exceptions-v6;
                       log;
                       accept;
                   }
               }
           }
       }

       family any {
           filter protect-router-control-plane-non-ip {
               term rate-limit-non-ip {
                   then {
                       policer 250kbps;
                       accept;
                   }
               }
           }
       }
   }
   interfaces {
       lo0 {
           unit 0 {
               family inet {
                   filter input protect-router-control-plane;
               }
               family inet6 {
                   filter input protect-router-control-plane-v6;
               }
               family any {
                   filter input protect-router-control-plane-non-ip;
               }
           }
       }
   }