你应该通过BGP发送路由,这是Bird 1.6.4 BGP服务器的配置,运行在linux和microtik路由器客户端上,通过隧道连接。雷竞技网站分配ip地址的隧道端点如下:
192.168.111.1,适配器名称:tun0 - Linux服务器
192.168.111.2,适配器名称:ovpn-out1 - microtik客雷竞技网站户端
首先安装BIRD服务器,创建路由表50,echo "50 mikrotik">>/etc/iproute2/rt_table,然后雷竞技网站添加以下配置:
/etc/bird.conf:
日志“/var/ Log /bird.log”全部;协议内核{学习;扫描时间20;出口;内核表50;}协议设备{扫描时间180;}协议静态{导入none;经由tun0的1.2.3.0/24路由;通过tun0路由192.168.10.0/24;通过tun0路由192.168.20.0/24; route 10.10.0.0/16 via "tun0"; } protocol bgp internal { debug all; description "My BGP uplink"; local as 65000; neighbor 192.168.111.2 as 64496; multihop; hold time 360; startup hold time 5; connect retry time 20; router id 192.168.235.1; keepalive time 120; connect delay time 5; error wait time 5, 300; next hop self; path metric 1; default bgp_med 0; default bgp_local_pref 0; source address 192.168.111.1; export filter { print "exporting internal"; accept; }; }
雷竞技网站BGP配置;
/routing BGP instance set default as=64496 client-to-client-reflection=no router-id=192.168.111.2 /routing BGP network add network=192.168.111.0/24 synchronize=no /routing BGP peer add hold-time=6m keepalive-time=20s multihop=yes name=192.168.111.2 \ remote-address=192.168.111.1 remote-as=65000 ttl=default update-source=ovpn-out1
这些配置将获得Mikrotik路由1.2.3.雷竞技网站0/24,192.168.10.0/24,192.168.20.0/24,10.10.0.0/16和任何目的地,存在于linux服务器上的路由表50中(在linux上使用类似' ip route add 192.168.200.0/24 dev tun0 table 50 '来添加或' ip route del 192.168.200.0/24 dev tun0 table 50 '来删除Mikrotik的路由)