yabgpd is a BGP agent that can orchestrate the BGP routers. You may start the agent as a Python application. Make sure to update the correct values for the BGP local and remote addresses, and the local and remote BGP autonomous system values. The program will print a set of log lines as follows:
$ python yabgpd --bgp-local_addr=172.31.0.232 --bgp-local_as=23650 --bgp-remote_addr=52.58.130.47 --bgp-remote_as=23650 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] Log (Re)opened. 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] Configuration: 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] ****************************************************** 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] Configuration options gathered from: 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] command line args: ['--bgp-local_addr=172.31.0.232', '--bgp-local_as=23650', '--bgp-remote_addr=10.124.1.245', '--bgp-remote_as=23650'] 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] config files: [] 2017-07-16 16:19:05,837.837 78465 INFO yabgp.agent [-] ======================================================= .... ... 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---remote_as = 23650 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---remote_addr = 10.124.1.245 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---local_as = 23650 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---local_addr = 172.31.0.232 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---capability = {'remote': {}, 'local': {'cisco_route_refresh': True, 'route_refresh': True, 'graceful_restart': True, 'cisco_multi_session': True, 'four_bytes_as': True, 'enhanced_route_refresh': True, 'add_path': None}} 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---afi_safi = ['ipv4'] 2017-07-16 16:19:05,840.840 78465 INFO yabgp.agent [-] ---md5 = None 2017-07-16 16:19:05,840.840 78465 INFO yabgp.handler.default_handler [-] Create dir /home/ubuntu/data/bgp/10.124.1.245 for peer 10.124.1.245 2017-07-16 16:19:05,840.840 78465 INFO yabgp.handler.default_handler [-] BGP message file path is /home/ubuntu/data/bgp/10.124.1.245 2017-07-16 16:19:05,840.840 78465 INFO yabgp.handler.default_handler [-] get the last bgp message seq for this peer 2017-07-16 16:19:05,840.840 78465 INFO yabgp.handler.default_handler [-] BGP message file 1500221945.84.msg 2017-07-16 16:19:05,840.840 78465 INFO yabgp.handler.default_handler [-] The last bgp message seq number is 0 2017-07-16 16:19:05,841.841 78465 INFO yabgp.agent [-] Create BGPPeering twsited instance 2017-07-16 16:19:05,841.841 78465 INFO yabgp.core.factory [-] Init BGPPeering for peer 10.124.1.245 2017-07-16 16:19:05,841.841 78465 INFO yabgp.agent [-] Prepare RESTAPI service 2017-07-16 16:19:05,842.842 78465 INFO yabgp.agent [-] serving RESTAPI on http://0.0.0.0:8801 2017-07-16 16:19:05,842.842 78465 INFO yabgp.agent [-] Starting BGPPeering twsited instance 2017-07-16 16:19:05,842.842 78465 INFO yabgp.core.fsm [-] Automatic start 2017-07-16 16:19:05,842.842 78465 INFO yabgp.core.fsm [-] Do not need Idle Hold, start right now. 2017-07-16 16:19:05,842.842 78465 INFO yabgp.core.fsm [-] Connect retry counter: 0 2017-07-16 16:19:05,843.843 78465 INFO yabgp.core.fsm [-] Connect retry timer, time=30 2017-07-16 16:19:05,843.843 78465 INFO yabgp.core.fsm [-] [10.124.1.245]State is now:CONNECT 2017-07-16 16:19:05,843.843 78465 INFO yabgp.core.factory [-] (Re)connect to 10.124.1.245 ....
As can be seen from the logs, the BGP message file is created in the folder, /home/ubuntu/data/bgp/10.124.1.245.
By analyzing the logs, you may notice logs are stored from both the remote and local BGP addresses:
$ tree /home/ubuntu/data/bgp /home/ubuntu/data/bgp ├── 10.124.1.245 │ └── msg │ └── 1500221945.84.msg └── 52.58.130.47 └── msg └── 1500221444.73.msg