diff --git a/README.md b/README.md index 7ed2a1be..0153be3e 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ bcg uses RFC 8092 BGP Large Communities | router-id | Router ID of this router | | prefixes | List of prefixes to originate | | irrdb | IRRDB to query prefix sets from (default is rr.ntt.net which includes generated route objects from RPKI ROAs) | +| rtrserver | IP address or hostname of RPKI RTR server (default is 127.0.0.1) | | peers | Map of name to peer (see below) | #### Peer Configuration Options diff --git a/parser.go b/parser.go index d3e8fb74..b15dd0cf 100644 --- a/parser.go +++ b/parser.go @@ -47,11 +47,12 @@ type Peer struct { // Config contains global configuration about this router and BCG instance type Config struct { - Asn uint32 `yaml:"asn" toml:"ASN" json:"asn"` - RouterId string `yaml:"router-id" toml:"Router-ID" json:"router-id"` - Prefixes []string `yaml:"prefixes" toml:"Prefixes" json:"prefixes"` - Peers map[string]*Peer `yaml:"peers" toml:"Peers" json:"peers"` - IrrDb string `yaml:"irrdb" toml:"IRRDB" json:"irrdb"` + Asn uint32 `yaml:"asn" toml:"ASN" json:"asn"` + RouterId string `yaml:"router-id" toml:"Router-ID" json:"router-id"` + Prefixes []string `yaml:"prefixes" toml:"Prefixes" json:"prefixes"` + Peers map[string]*Peer `yaml:"peers" toml:"Peers" json:"peers"` + IrrDb string `yaml:"irrdb" toml:"IRRDB" json:"irrdb"` + RtrServer string `yaml:"rtrserver" toml:"RPKIServer" json:"rtrserver"` } // PeerTemplate contains a peer-specific config sent to template @@ -270,6 +271,12 @@ func main() { } log.Infof("Using IRRDB server %s", config.IrrDb) + // Set default RTR server + if config.RtrServer == "" { + config.RtrServer = "127.0.0.1" + } + log.Infof("Using IRRDB server %s", config.IrrDb) + // Validate Router ID in dotted quad format if net.ParseIP(config.RouterId).To4() == nil { log.Fatalf("Router ID %s is not in valid dotted quad notation", config.RouterId) diff --git a/templates/global.tmpl b/templates/global.tmpl index dd0c989c..174e40c2 100644 --- a/templates/global.tmpl +++ b/templates/global.tmpl @@ -91,7 +91,7 @@ protocol rpki { roa6 { table rpki6; }; transport tcp; - remote "127.0.0.1" port 8282; + remote "{{ .Config.RtrServer }}" port 8282; retry keep 90; refresh keep 900;