At this time it's possible generate ASNs only from network file list, if file exist /etc/pmacct/networks.lst.
- I'v found a bug: it is doesn't work until you add a "uacctd_as: file" option in configuration file.
- I'v make a patch to add functionality generate ASNs from BGP thread.
From pmacct documentation this is a basic working configuration:
pmacctd_as: bgp
bgp_daemon: true
bgp_daemon_ip: 127.0.0.1
bgp_agent_map: /path/to/agent_to_peer.map
bgp_daemon_port: 17917
The bgp_daemon_port can be changed from the standard BGP port (179/TCP) in order to co-exist with other BGP routing software which might be running on the same host. Furthermore, they can safely peer each other by using 127.0.0.1 as bgp_daemon_ip. In pmacctd, bgp_agent_map does the trick of mapping 0.0.0.0 to the IP address of the BGP peer (ie. 127.0.0.1: 'id=127.0.0.1 ip=0.0.0.0'); this setup, while generic, was tested working in conjunction with Quagga 0.99.14. Following a relevant fragment of the Quagga configuration:
router bgp Y
bgp router-id X.X.X.X
neighbor 127.0.0.1 remote-as Y
neighbor 127.0.0.1 port 17917
neighbor 127.0.0.1 update-source X.X.X.X
!
I'v created a bgp-daemon template in path: system netflow-accounting, and all necessary changes for generation config file and bgp_agent_map. My changes also fix bug described above.