BIRD2を利用したBGPルーターのサンプル
name | description |
---|---|
172.16.70.1 | ルーターのIP |
172.16.70.0/24 | 広報するIP |
65001 | 自分ASN |
10.1.0.1 | 境界IP |
65002 | 相手のASN |
router id 172.16.70.1; | |
log syslog { info, remote, warning, error, auth, fatal, bug }; | |
log stderr all; | |
debug protocols {events, states, interfaces}; | |
graceful restart wait 15; | |
protocol kernel { | |
ipv4 { | |
import none; | |
export all; | |
}; | |
learn; | |
scan time 10; | |
} | |
protocol static { | |
ipv4; | |
route 172.16.70.0/24 blackhole; | |
} | |
protocol direct { | |
ipv4; | |
interface "eth0"; | |
} | |
protocol device { | |
scan time 100; | |
} | |
protocol bgp bgp1 { | |
local as 65001; | |
neighbor 10.1.0.1 as 65002; | |
ipv4 { | |
next hop self; | |
import all; | |
export filter { | |
if net ~ [172.16.70.0/24] then accept; | |
if source = RTS_BGP then accept; | |
reject; | |
}; | |
}; | |
} |