NIST BGP SRx的使用

NIST BGPsec的使用

地址:https://github.com/usnistgov/NIST-BGP-SRx

推荐使用centos 7。

  1. 安装依赖包,就是CAT CONTENT | grep requires下面那个命令cat CONTENT | grep requires | sort -u | sed -e "s/- requires/yum install -y /g" | sh,可以直接装,装不上的也没关系,反正可用,如果报错再排错呗。
  2. 编译,直接执行它的那个buildBGP-SRx.sh -A就可以了。
  3. 剩下的内容根据它的docker教程来。主要是启动3个程序。

1. 启动RPKI-server

# 配置文件不是这样设置,看下面吧。留在这里,可以执行,修改即可。
echo "add 10.0.0.0/8 9 7675" > /tmp/rpkirtr_svr.conf

<NIST_HOME>/local-6.2.0/bin/rpkirtr_svr -f /tmp/rpkirtr_svr.conf

这个只需要启动一个,剩下的都需要连接到它。配置相对简单:配置可以参考:examples/config-rpki。添加ROA需要是add 10.5.0.0/20 24 65005,即add <路由前缀,最大前缀长度,AS号>。添加bgpseckey,则只需要指定密钥位置:examples/bgpsec-keys/raw-keys,然后指定cert文件就行了。至于启动后,可以使用help命令查看命令具体格式。例如cacheclients可以分别查看当前RPKI存储库内容和已经连接的客户端(srx-server)。

echo "This is the BGP-SRx RPKI Cache Test Harness"

echo "Add ROA configurations"
add 11.0.0.0/8 9 100
add 12.0.0.0/8 9 200

echo "Add Key Configuration"
keyLoc /usr/local/src/NIST-BGP-SRx/local-6.2.0/opt/bgp-srx-examples/bgpsec-keys/raw-keys
addKey 100 65005.cert
addKey 200 65005.cert
addKey 65005 65005.cert
addKey 65010 65010.cert
addKey 65015 65015.cert
addKey 65020 65020.cert
addKey 65025 65025.cert
addKey 65030 65030.cert
addKey 65040 65040.cert

echo "Cache Contents:"
cache

2. 启动SRX-server

sed "s/localhost/<本机IP地址>/g" <NIST_HOME>/srx-server/src/server/srx_server.conf > /tmp/srx_server.conf

<NIST_HOME>/local-6.2.0/bin/srx_server -f /tmp/srx_server.conf

这个每个节点启动一个,自己连接自己的。配置中只有一个需要修改:就是rpki 的host是启动的那台节点的ip地址。

verbose  = true;
loglevel = 5;
#log     = "/var/log/srx_server.log";
sync    = true;
port    = 17900;

console: {
  port = 17901;
  password = "x";
};

rpki: {
  host = "192.168.1.8"; #########################且只有这里需要修改
  # Default port (RFC6810) is 323 but needs root privilege on the server side
  #port = 50001;
  port = 323;
  # supports 2 versions: 0 => RFC6810, 1 => RFC8210, 2 => draft-RFC8210bis
  router_protocol = 2;
};

bgpsec: {
  # Allows to set a configuration file for path valiation
  #srxcryptoapi_cfg = "<configuration file>";

  # Synchronize the logging settings of SCA with the logging settings of
  # srx-server. If set to false the sca configuration takes precedence
  sync_logging = true;
};

mode: {
  no-sendqueue = true;
  no-receivequeue = false;
};

mapping: {
#The configuration allows 255 pre-configurations. client_0 is invalid
  client_1  = "2";
  client_10 = "10.0.0.1";
  client_25 = "10.1.1.2";
};

3. 启动bgpd

# 这个更费,不是这样改的,还需要改很多配置
sed "s/srx connect/srx connect <本机IP> 17900/g" ./quagga-srx/bgpd/bgpd.conf.sampleSRx > /tmp/bgpd.conf

<NIST_HOME>/local-6.2.0/sbin/bgpd -f /tmp/bgpd.conf

每个节点一个。配置比较麻烦。首先是bgp自己的东西,这些对应即可。

注意它给的配置文件中,

  1. srx proxy-id和连接的srx set-server都设置成当前机器ip地址
  2. verified这个内容有问题,这行需要注释掉。
  3. no srx ...这些需要在2级,也就是说出了router bgp 100这个在1级,剩下的都要对齐到这里。
  4. srx bgpsec ski这个需要从rpki中的cache查看,就有ski了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值