Hi Håvard, Oh, Zebra daemon is also running?
Ryu's Zebra protocol "server" service will perform as Zebra daemon against the other Quagga daemons (e.g., OSPFd, BGPd). You don't need to start "/usr/lib/quagga/zebra". Say Zebra daemon as "server" and the other Quagga daemons as "client" (which means OSPFd is a client side application against Zebra daemon; - "ryu/services/protocols/zebra/server" provides the "server" side application framework - "ryu/services/protocols/zebra/client" provides the "client" side application framework Thus, you need to start Zebra daemon if you use "ryu/services/protocols/zebra/client", but don't need to start Zebra daemon if you use "ryu/services/protocols/zebra/server". Thanks, Iwase On 2017年05月08日 17:44, Håvard Magne Fagervoll wrote: > Hi Iwase, > > Thanks for getting back to me. > > I have tried some of your suggestions, but still doesn't seem to be able to > connect to the API. > > *My config files look like this:* > ! OSPF configuration for r3 > ! > hostname r3 > password zebra > ! > router ospf > passive-interface r3-eth0 > network 10.0.3.0/24 <http://10.0.3.0/24> area 0.0.0.0 > network 10.1.100.0/24 <http://10.1.100.0/24> area 0.0.0.0 > > ! > log stdout > > *and* > > ! Configuration for zebra (NB: it is the same for all routers) > ! > hostname zebra > password zebra > log stdout > > > *I have been running the example with this command, but also tried different > ports (2600, 2601, 2604):* > $ sudo ryu-manager sample_dumper.py --verbose --zapi-router-id 10.1.100.3 > --zapi-server-host /var/run/quagga/zebrar3.api --zapi-server-port 2600 > lzma module is not available > Registered VCS backend: git > Registered VCS backend: hg > Registered VCS backend: svn > Registered VCS backend: bzr > loading app sample_dumper.py > instantiating app None of ZServer > creating context zserver > instantiating app sample_dumper.py of ZServerDumper > BRICK ZServer > PROVIDES EventZClientDisconnected TO {'ZServerDumper': set([])} > PROVIDES EventZebraRouterIDAdd TO {'ZServer': set([])} > PROVIDES EventZebraInterfaceAdd TO {'ZServer': set([])} > PROVIDES EventZebraHello TO {'ZServer': set([])} > PROVIDES EventZebraIPv4RouteAdd TO {'ZServer': set([]), 'ZServerDumper': > set([])} > PROVIDES EventZebraIPv6RouteAdd TO {'ZServer': set([]), 'ZServerDumper': > set([])} > PROVIDES EventZebraIPv4RouteDelete TO {'ZServer': set([]), 'ZServerDumper': > set([])} > PROVIDES EventZClientConnected TO {'ZServerDumper': set([])} > PROVIDES EventZebraIPv6RouteDelete TO {'ZServer': set([]), 'ZServerDumper': > set([])} > CONSUMES EventZebraRouterIDAdd > CONSUMES EventZebraInterfaceAdd > CONSUMES EventZebraHello > CONSUMES EventZebraIPv4RouteAdd > CONSUMES EventZebraIPv6RouteAdd > CONSUMES EventZebraIPv4RouteDelete > CONSUMES EventZebraIPv6RouteDelete > BRICK ZServerDumper > CONSUMES EventZClientDisconnected > CONSUMES EventZebraIPv4RouteAdd > CONSUMES EventZebraIPv6RouteAdd > CONSUMES EventZebraIPv4RouteDelete > CONSUMES EventZClientConnected > CONSUMES EventZebraIPv6RouteDelete > Added interface "lo": Interface(ifname='lo', inet6='::1/128', > inet='127.0.0.1/8 <http://127.0.0.1/8>') > Added route to "127.0.0.0/8 <http://127.0.0.0/8>": Route(family=2, safi=1, > route_type=2, destination='127.0.0.0/8 <http://127.0.0.0/8>', > source='127.0.0.1/8 <http://127.0.0.1/8>', ifindex=1, is_selected=True, > gateway='') > > > *When looking at my daemons*: > $ ps aux | grep quagga > quagga 12355 0.0 0.0 24468 2356 ? Ss 09:51 0:00 > /usr/lib/quagga/zebra -d -f /etc/quagga/configs/zebra.conf -z > /var/run/quagga/zebrar3.api -i /var/run/quagga/zebrar3.pid > quagga 12357 0.0 0.0 27116 2420 ? Ss 09:51 0:00 > /usr/lib/quagga/ospfd -d -f /etc/quagga/configs/quagga3.conf -z > /var/run/quagga/zebrar3.api -i /var/run/quagga/ospfdr3.pid > > *When connecting to the local ospf daemon:* > $ sudo vtysh -d ospfd -c "show ip ospf database" > > OSPF Router with ID (10.1.100.3) > > Router Link States (Area 0.0.0.0) > > Link ID ADV Router Age Seq# CkSum Link count > 10.1.100.1 10.1.100.1 356 0x80000006 0x6eed 2 > 10.1.100.2 10.1.100.2 356 0x80000007 0x7fd7 2 > 10.1.100.3 10.1.100.3 356 0x80000006 0x94bf 2 > > Net Link States (Area 0.0.0.0) > > Link ID ADV Router Age Seq# CkSum > 10.1.100.3 10.1.100.3 356 0x80000002 0x6ead > * > * > *In my topology, quagga is running on a host and the host has these ports > open:* > $ netstat -nltp > Active Internet connections (only servers) > Proto Recv-Q Send-Q Local Address Foreign Address State > PID/Program name > tcp 0 0 0.0.0.0:2601 <http://0.0.0.0:2601> > 0.0.0.0:* LISTEN 15984/zebra > tcp 0 0 0.0.0.0:2604 <http://0.0.0.0:2604> > 0.0.0.0:* LISTEN 15986/ospfd > > > > I hope this info may clarify a couple of things. > Thanks. > > Håvard > > 2017-05-08 7:48 GMT+02:00 Iwase Yusuke <iwase.yusu...@gmail.com > <mailto:iwase.yusu...@gmail.com>>: > > Hi Håvard, > > Sorry for the delay. > > Could you share log messages of your ryu-manager with "--verbose" option? > > On my environment(Ubuntu 16.04 and Quagga via apt-get), > "sample_dumper.py" should work. > > # /etc/quagga/daemons > ...(snip) > zebra=no > bgpd=no > ospfd=yes > ...(snip) > > # /etc/quagga/ospfd.conf (Just copy of > /usr/share/doc/quagga/examples/ospfd.conf.sample) > ! -*- ospf -*- > ! > ! OSPFd sample configuration file > ! > ! > hostname ospfd > password zebra > !enable password please-set-at-here > ! > !router ospf > ! network 192.168.1.0/24 <http://192.168.1.0/24> area 0 > ! > log stdout > > # Run Ryu Application > $ ryu-manager ryu/services/protocols/zebra/server/sample_dumper.py > --verbose > ... > > # Start Quagga (OSPF) daemon > $ sudo service quagga start > > # ryu-manager should output > Registered VCS backend: git > Registered VCS backend: hg > Registered VCS backend: svn > Registered VCS backend: bzr > loading app ryu/services/protocols/zebra/server/sample_dumper.py > instantiating app None of ZServer > creating context zserver > instantiating app ryu/services/protocols/zebra/server/sample_dumper.py of > ZServerDumper > BRICK ZServer > PROVIDES EventZebraIPv4RouteAdd TO {'ZServer': set(), 'ZServerDumper': > set()} > PROVIDES EventZClientConnected TO {'ZServerDumper': set()} > PROVIDES EventZebraIPv6RouteDelete TO {'ZServer': set(), > 'ZServerDumper': set()} > PROVIDES EventZebraIPv6RouteAdd TO {'ZServer': set(), 'ZServerDumper': > set()} > PROVIDES EventZebraInterfaceAdd TO {'ZServer': set()} > PROVIDES EventZebraHello TO {'ZServer': set()} > PROVIDES EventZClientDisconnected TO {'ZServerDumper': set()} > PROVIDES EventZebraRouterIDAdd TO {'ZServer': set()} > PROVIDES EventZebraIPv4RouteDelete TO {'ZServer': set(), > 'ZServerDumper': set()} > CONSUMES EventZebraIPv4RouteAdd > CONSUMES EventZebraIPv6RouteDelete > CONSUMES EventZebraIPv6RouteAdd > CONSUMES EventZebraInterfaceAdd > CONSUMES EventZebraHello > CONSUMES EventZebraRouterIDAdd > CONSUMES EventZebraIPv4RouteDelete > BRICK ZServerDumper > CONSUMES EventZClientDisconnected > CONSUMES EventZClientConnected > CONSUMES EventZebraIPv6RouteDelete > CONSUMES EventZebraIPv6RouteAdd > CONSUMES EventZebraIPv4RouteAdd > CONSUMES EventZebraIPv4RouteDelete > Added interface "lo": Interface(inet6='::1/128', inet='127.0.0.1/8 > <http://127.0.0.1/8>', ifname='lo') > Added route to "127.0.0.0/8 <http://127.0.0.0/8>": Route(safi=1, > family=<AddressFamily.AF_INET: 2>, is_selected=True, source='127.0.0.1/8 > <http://127.0.0.1/8>', destination='127.0.0.0/8 <http://127.0.0.0/8>', > route_type=2, gateway='', ifindex=1) > Connected from client: b'': <eventlet.greenio.base.GreenSocket object at > 0x7f6da742d550> > EVENT ZServer->ZServerDumper EventZClientConnected > Notify event: > EventZebraHello(zclient=<ryu.services.protocols.zebra.server.zserver.ZClient > object at 0x7f6da742d438>, version=2, length=7, command=23, vrf_id=0, > body=ZebraHello(route_type=6)) > EVENT ZServer->ZServer EventZebraHello > Notify event: > EventZebraRouterIDAdd(zclient=<ryu.services.protocols.zebra.server.zserver.ZClient > object at 0x7f6da742d438>, version=2, length=6, command=20, vrf_id=0, > body=None) > EVENT ZServer->ZServer EventZebraRouterIDAdd > Notify event: > EventZebraInterfaceAdd(zclient=<ryu.services.protocols.zebra.server.zserver.ZClient > object at 0x7f6da742d438>, version=2, length=6, command=1, vrf_id=0, > body=None) > EVENT ZServer->ZServer EventZebraInterfaceAdd > Zebra client connected: b'' > Client <ryu.services.protocols.zebra.server.zserver.ZClient object at > 0x7f6da742d438> says hello and bids fair to announce only 6 routes > Client <ryu.services.protocols.zebra.server.zserver.ZClient object at > 0x7f6da742d438> requests router_id, server will response: router_id=1.1.1.1 > Zebra protocol version mismatch:server_version=2, msg.version=3 > Client <ryu.services.protocols.zebra.server.zserver.ZClient object at > 0x7f6da742d438> requested all interfaces > Server will response interfaces: [Interface(ifname='lo', > inet='127.0.0.1/8 <http://127.0.0.1/8>', ll_type=1, status=5, > hw_addr='00:00:00:00:00:00', metric=1, flags=73, inet6='::1/128', > bandwidth=0, ifmtu6=65536, ifindex=1, ifmtu=65536)] > Zebra protocol version mismatch:server_version=2, msg.version=3 > Server will response routes: [Route(safi=1, family=2, is_selected=True, > source='127.0.0.1/8 <http://127.0.0.1/8>', gateway='', > destination='127.0.0.0/8 <http://127.0.0.0/8>', ifindex=1, route_type=2, > id=1)] > Zebra protocol version mismatch:server_version=2, msg.version=3 > > > > The API daemon is '/var/run/quagga/zebrar3.api' > > In order to change the path to API unix domain socket, you can use > "--zapi-server-host" option. > > > Thanks, > Iwase > > > On 2017年05月06日 04:30, Håvard Magne Fagervoll wrote: > > Hello, > > > > I a working with the zebra API and want to connect to an OSPF daemon > running on my local machine. I am currently testing with > "ryu/services/protocols/zebra/server/sample_dumper.py" and I am trying to > edit the "flags.py" file in the root ryu folder to correctly connect to my > daemon, but it's not really working. > > > > I am running ubuntu 14.04. > > The API daemon is '/var/run/quagga/zebrar3.api' > > It is running OSPF > > The router ID is '10.1.100.3'. > > > > How can I set up the config correctly? > > > > Thank you. > > Best regards > > Håvard > > > > > > > ------------------------------------------------------------------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > > > > > _______________________________________________ > > Ryu-devel mailing list > > Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.sourceforge.net> > > https://lists.sourceforge.net/lists/listinfo/ryu-devel > <https://lists.sourceforge.net/lists/listinfo/ryu-devel> > > > > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel