# The router ID of a BGP router can theoretically be anything. # It's common practice to set it to the IPv4 address that other routers will peer with. router id 192.168.179.2; # Export all learned IPv4 routes from peers into the kernel's routing table. # This turns a BGP route server into a BGP router. # Visible with `ip route show`. protocol kernel { ipv4 { import all; export filter { if source = RTS_STATIC then reject; krt_prefsrc = 192.168.179.2; accept; }; }; } # Export all learned IPv6 routes from peers into the kernel's routing table. # This turns a BGP route server into a BGP router. # Visible with `ip -6 route show`. protocol kernel { ipv6 { import all; export filter { if source = RTS_STATIC then reject; krt_prefsrc = fd00::2; accept; }; }; } # The IPv4 routes to be announced. protocol static { ipv4; route 172.16.0.1/32 reject; route 172.16.0.2/32 reject; route 172.16.0.3/32 reject; } # The IPv6 routes to be announced. protocol static { ipv6; route fd00:cafe:babe::1/128 reject; route fd00:cafe:babe::1/128 reject; route fd00:cafe:babe::1/128 reject; } # Avoid hammering the kernel's routing table unnecessarily. protocol device { scan time 10; } # You can template peers. template bgp PEER { # The ASN this router announces as. local as 2; ipv4 { # DON'T EVER DO THIS ON THE REAL INTERNET. # THIS IS HOW ROUTE LEAKS AND BGP HIJACKS HAPPEN. import all; export all; }; ipv6 { # DON'T EVER DO THIS ON THE REAL INTERNET. # THIS IS HOW ROUTE LEAKS AND BGP HIJACKS HAPPEN. import all; export all; }; } # Peer with AS1! :-) protocol bgp AS1 from PEER { # The IP address and ASN of the peer. neighbor 192.168.179.1 as 1; } # Peer with AS1! :-) protocol bgp AS1 from PEER { # The IP address and ASN of the peer. neighbor 192.168.179.1 as 1; }