Signed-off-by: ISHIDA Wataru <[email protected]>
---
 ryu/services/protocols/bgp/bgp_sample_conf.py |  113 +++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
 create mode 100644 ryu/services/protocols/bgp/bgp_sample_conf.py

diff --git a/ryu/services/protocols/bgp/bgp_sample_conf.py 
b/ryu/services/protocols/bgp/bgp_sample_conf.py
new file mode 100644
index 0000000..61f203c
--- /dev/null
+++ b/ryu/services/protocols/bgp/bgp_sample_conf.py
@@ -0,0 +1,113 @@
+import os
+
+# =============================================================================
+# BGP configuration.
+# =============================================================================
+BGP = {
+
+    # General BGP configuration.
+    'routing': {
+        # ASN for this BGP instance.
+        'local_as': 64512,
+
+        # BGP Router ID.
+        'router_id': '10.10.0.1',
+
+        # We list all BGP neighbors below. We establish EBGP sessions with peer
+        # with different AS number then configured above. We will
+        # establish IBGP session if AS number is same.
+        'bgp_neighbors': {
+            '10.0.0.1': {
+                'remote_as': 64513,
+                'multi_exit_disc': 100
+                },
+            '10.10.0.2': {
+                'remote_as': 64514,
+                },
+        },
+
+        'networks': [
+            '10.20.0.0/24',
+            '10.30.0.0/24',
+            '10.40.0.0/16',
+            '10.50.0.0/16',
+        ],
+    },
+
+}
+
+# =============================================================================
+# Logging configuration.
+# =============================================================================
+LOGGING = {
+
+    # We use python logging package for logging.
+    'version': 1,
+    'disable_existing_loggers': False,
+
+    'formatters': {
+        'verbose': {
+            'format': '%(levelname)s %(asctime)s %(module)s ' +
+                      '[%(process)d %(thread)d] %(message)s'
+        },
+        'simple': {
+            'format': '%(levelname)s %(asctime)s %(module)s %(lineno)s ' +
+                      '%(message)s'
+        },
+        'stats': {
+            'format': '%(message)s'
+        },
+    },
+
+    'handlers': {
+        # Outputs log to console.
+        'console': {
+            'level': 'DEBUG',
+            'class': 'logging.StreamHandler',
+            'formatter': 'simple'
+        },
+        'console_stats': {
+            'level': 'DEBUG',
+            'class': 'logging.StreamHandler',
+            'formatter': 'stats'
+        },
+        # Rotates log file when its size reaches 10MB.
+        'log_file': {
+            'level': 'ERROR',
+            'class': 'logging.handlers.RotatingFileHandler',
+            'filename': os.path.join('.', 'bgpspeaker.log'),
+            'maxBytes': '10000000',
+            'formatter': 'verbose'
+        },
+        'stats_file': {
+            'level': 'DEBUG',
+            'class': 'logging.handlers.RotatingFileHandler',
+            'filename': os.path.join('.', 'statistics_bgps.log'),
+            'maxBytes': '10000000',
+            'formatter': 'stats'
+        },
+    },
+
+    # Fine-grained control of logging per instance.
+    'loggers': {
+        'bgpspeaker': {
+            'handlers': ['console', 'log_file'],
+            'handlers': ['console'],
+            'level': 'DEBUG',
+            'propagate': False,
+        },
+        'stats': {
+            'handlers': ['stats_file', 'console_stats'],
+            'level': 'INFO',
+            'propagate': False,
+            'formatter': 'stats',
+        },
+    },
+
+    # Root loggers.
+    'root': {
+        'handlers': ['console', 'log_file'],
+        'level': 'DEBUG',
+        'propagate': True,
+    },
+}
-- 
1.7.9.5


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to