Skip to content

Commit

Permalink
- update and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cklewar committed Apr 7, 2018
1 parent cae5cd1 commit 26883ab
Show file tree
Hide file tree
Showing 12 changed files with 529 additions and 195 deletions.
9 changes: 7 additions & 2 deletions data/frt.py → data/fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
# limitations under the License.
#

import os

from jnpr.junos.factory import loadyaml
from os.path import splitext
_YAML_ = splitext(__file__)[0] + '.yml'
globals().update(loadyaml(_YAML_))

_YAML_ = os.getcwd() + '/data/frt.yml'
globals().update(loadyaml(_YAML_))
_YAML_ = os.getcwd() + '/data/frft.yml'
globals().update(loadyaml(_YAML_))
20 changes: 20 additions & 0 deletions data/frft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# $Id$
# Yaml widgets for BGP flow filter data extraction
# - FlowFilterTable extracts 'show firewall filter __flowspec_default_inet__'
# - FlowFilterView identifies most relevant filter fields
# including counter-name, packet-cpunt and byte-count
---
FlowFilterTable:
rpc: get-firewall-filter-information
args:
filtername: __flowspec_default_inet__
args_key: filtername
item: filter-information/counter
key: counter-name
view: FlowFilterView

FlowFilterView:
fields:
name: counter-name
packet_count: packet-count
byte_count: byte-count
296 changes: 208 additions & 88 deletions main.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ age_out_interval: 00:01:00
dev_ip: 10.11.111.120
dev_pw: juniper123
dev_user: root
asbrs:
- asbr1:
ip: 10.11.111.121
- asbr2:
ip: 10.11.111.122
```
- Start tool
+ Python binary should be in path if not use `which python2.7` to obtian path info
Expand Down
2 changes: 1 addition & 1 deletion template/delete-flow-route.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
routing-options {
flow {
delete:
route {{flowRouteName}};
route {{ flowRouteName }};
}
}
2 changes: 1 addition & 1 deletion template/mod-flow-route.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
routing-options {
flow {
route {{flowRouteName}} {
route {{ flowRouteName }} {
replace:
match {
destination {{dstPrefix}};
Expand Down
2 changes: 1 addition & 1 deletion template/set-flow-route.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
routing-options {
flow {
route {{flowRouteName}} {
route {{ flowRouteName }} {
match {
destination {{dstPrefix}};
{%- if dstPort is defined and dstPort !=None %}
Expand Down
8 changes: 7 additions & 1 deletion ui/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
age_out_interval: 00:01:00
dev_ip: 10.11.111.120
dev_pw: juniper123
dev_user: root
routers:
- rt1:
type: rr
ip: 10.11.111.120
- rt2:
type: asbr
ip: 10.11.111.121
43 changes: 37 additions & 6 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@
</head>
<body>

<div class="container"><h2 style="text-align:left;float:left;">DevOps against DDoS</h2>
<div class="container col-sm-9 col-md-8 col-lg-12"><h2 style="text-align:left;float:left;">DevOps against DDoS</h2>
<h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP FlowSpec with Junos PyEZ</h2></div>
<div id="exTab1" class="container">
<div id="exTab1" class="container col-sm-9 col-md-8 col-lg-12">
<ul class="nav nav-pills mynav">
<li class="active">
<a href="#overview" data-toggle="tab">Overview</a>
</li>
<li><a href="#flowConfiguration" data-toggle="tab">Flow Configuration</a>
<li><a href="#flowConfiguration" data-toggle="tab">Static Flow Configuration</a>
</li>
<li><a href="#flowActive" data-toggle="tab">Active Flows</a>
</li>
<li><a href="#filterActive" data-toggle="tab">Active Flow Filters</a>
</li>
<li><a href="#settings" data-toggle="tab">Settings</a>
</li>
</ul>
Expand All @@ -57,7 +59,7 @@ <h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP Flow
<div class="tab-pane" id="flowConfiguration">
<br/>
<div class="panel panel-default">
<div class="panel-heading"><h3>Flow Configuration</h3></div>
<div class="panel-heading"><h3>Route Reflector Static Flow Configuration</h3></div>
<div class="panel-body">
<p>
<button id="flowAddBtn" type="button" class="btn btn-primary btn-sm btn-custom" data-toggle="modal"
Expand Down Expand Up @@ -96,16 +98,18 @@ <h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP Flow
<div class="panel-heading"><h3>Active Flow Routes</h3></div>
<div class="panel-body">
<br/>
<table id="t_active_flow" class="display">
<table id="t_active_flow" class="display" style="width:100%">
<thead>
<tr>
<th>Router</th>
<th>Name</th>
<th>Destination Prefix</th>
<th>Source Prefix</th>
<th>Protocol</th>
<th>Destination Port</th>
<th>Source Port</th>
<th>Action</th>
<th>KRT Action</th>
<th>Community Action</th>
<th>Age</th>
</tr>
</thead>
Expand All @@ -115,6 +119,31 @@ <h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP Flow
</div>
</div>
</div>
<div class="tab-pane" id="filterActive">
<br/>
<div class="panel panel-default">
<div class="panel-heading"><h3>Active Flow Filter</h3></div>
<div class="panel-body">
<br/>
<table id="t_active_filter" class="display" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Destination Prefix</th>
<th>Source Prefix</th>
<th>Protocol</th>
<th>Destination Port</th>
<th>Source Port</th>
<th>Packet Count</th>
<th>Byte Count</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane" id="settings">
<br/>
<div class="panel panel-default">
Expand Down Expand Up @@ -220,6 +249,7 @@ <h4 class="modal-title">Add new flow route</h4>
<select class="form-control" id="selectAction">
<option>accept</option>
<option>discard</option>
<option>sample</option>
<option>community</option>
</select>
</div>
Expand Down Expand Up @@ -293,6 +323,7 @@ <h4 class="modal-title">Modify Flow Route</h4>
<select class="form-control" id="selectModAction">
<option>accept</option>
<option>discard</option>
<option>sample</option>
<option>community</option>
</select>
</div>
Expand Down
Loading

0 comments on commit 26883ab

Please sign in to comment.