From: Jana Babovakova Date: Tue, 10 Jun 2025 15:31:29 +0000 (+0200) Subject: Docs: replace all IPv4 examples with IPv6. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cb0e4fa5cf02fe4b23a23a945d2d1d470b10e94;p=thirdparty%2Fbird.git Docs: replace all IPv4 examples with IPv6. Thanks to Alexander Zubkov. --- diff --git a/doc/bird.sgml b/doc/bird.sgml index 8c70e485c..87f79d918 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -512,7 +512,7 @@ network interfaces found. protocol kernel { - ipv4 { + ipv6 { export all; # Default is export none }; persist; # Don't remove routes on BIRD shutdown @@ -521,8 +521,8 @@ protocol kernel { protocol device { } -protocol rip { - ipv4 { +protocol rip ng { + ipv6 { import all; export all; }; @@ -915,10 +915,17 @@ agreement"). interface "eth1", "eth4", "eth5" { type ptp; }; - start the protocol on enumerated interfaces with type ptp option. + interface -2001:db8:cafe::/48, 2001:db8::/32; - start the protocol + on all interfaces that have address from 2001:db8::/32, but not from + 2001:db8:cafe::/48. + interface -192.168.1.0/24, 192.168.0.0/16; - start the protocol on all interfaces that have address from 192.168.0.0/16, but not from 192.168.1.0/24. + interface "eth*" 2001:db8:cafe::/48; - start the protocol on all + ethernet interfaces that have address from 2001:db8:cafe::/48. + interface "eth*" 192.168.1.0/24; - start the protocol on all ethernet interfaces that have address from 192.168.1.0/24. @@ -1105,7 +1112,7 @@ protocol rip ng {

And this is even more complicated example using templates. template bgp { - local 198.51.100.14 as 65000; + local 2001:db8::beef as 65000; ipv4 { table mytable4; @@ -1120,7 +1127,7 @@ template bgp { } protocol bgp from { - neighbor 198.51.100.130 as 64496; + neighbor 2001:db8::cafe as 64496; # IPv4 channel is inherited as-is, while IPv6 # channel is adjusted by export filter option @@ -1567,13 +1574,24 @@ from the command line client. An example session might look like: pavel@bug:~/bird$ ./birdc -s bird.ctl BIRD 0.0.0 ready. bird> show route -10.0.0.0/8 dev eth0 [direct1 23:21] (240) -195.113.30.2/32 dev tunl1 [direct1 23:21] (240) -127.0.0.0/8 dev lo [direct1 23:21] (240) +Table master4: +10.0.0.0/8 unicast [direct1 23:21] (240) + dev eth0 +195.113.30.2/32 unicast [direct1 23:21] (240) + dev tunl1 + +Table master6: +2001:db8::/64 unicast [direct1 23:21] (240) + dev eth0 +2001:db8:0:1::/64 unicast [direct1 23:21] (240) + dev tunl1 + bird> show route ? -show route [] [table ] [filter ] [all] [primary]... -bird> show route filter { if 127.0.0.5 ˜ net then accept; } -127.0.0.0/8 dev lo [direct1 23:21] (240) +show route [|...] [table ] ... [filter |where ] [all] [primary]... +bird> show route filter { if 2001:db8:: ˜ net then accept; } +Table master6: +2001:db8::/64 unicast [direct1 23:21] (240) + dev eth0 bird> @@ -1644,7 +1662,7 @@ in the foot). notation (.mask(number) on values of type ip. It masks out all but first number bits from the IP address. So -

protocol bgp { - local 198.51.100.14 as 65000; # Use a private AS number - neighbor 198.51.100.130 as 64496; # Our neighbor ... + local 2001:db8::cafe as 65000; # Use a private AS number + neighbor 2001:db8::beef as 64496; # Our neighbor ... multihop; # ... which is connected indirectly authentication ao; # We use TCP-AO authentication keys { @@ -4176,7 +4198,7 @@ routes (in regular routing tables). All BGP protocols are monitored automaticall

protocol bmp { # The monitoring station to connect to - station address ip 198.51.100.10 port 1790; + station address ip 2001:db8::cafe port 1790; # Monitor received routes (in import table) monitoring rib in pre_policy; @@ -4461,7 +4483,7 @@ protocol kernel { # Primary routing table learn; # Learn alien routes from the kernel persist; # Do not remove routes on bird shutdown scan time 10; # Scan kernel routing table every 10 seconds - ipv4 { + ipv6 { import all; export all; }; @@ -4469,7 +4491,7 @@ protocol kernel { # Primary routing table protocol kernel { # Secondary routing table kernel table 100; - ipv4 { + ipv6 { table auxtable; export all; }; @@ -4576,8 +4598,8 @@ protocol bgp { vpn4 { table vpntab4; import all; export all; }; vpn6 { table vpntab6; import all; export all; }; mpls { label policy aggregate; }; - local 10.0.0.1 as 10; - neighbor 10.0.0.2 as 10; + local 2001:db8::cafe as 10; + neighbor 2001:db8::beef as 10; } # VRF 0 @@ -5254,8 +5276,8 @@ network. This attribute is read-only. Default is

-protocol ospf MyOSPF { - ipv4 { +protocol ospf v3 MyOSPF { + ipv6 { export filter { if source = RTS_BGP then { ospf_metric1 = 100; @@ -5298,8 +5320,8 @@ protocol ospf MyOSPF { area 120 { stub yes; networks { - 172.16.1.0/24; - 172.16.2.0/24 hidden; + 2001:db8:1::/48; + 2001:db8:2::/48 hidden; }; interface "-arc0" , "arc*" { type nonbroadcast; @@ -5309,9 +5331,9 @@ protocol ospf MyOSPF { poll 40; dead count 8; neighbors { - 192.168.120.1 eligible; - 192.168.120.2; - 192.168.120.10; + 2001:db8::1 eligible; + 2001:db8::2; + 2001:db8::a; }; }; }; @@ -5434,36 +5456,36 @@ Pipe protocol while decreasing their preferences and correcting their BGP paths to reflect the AS boundary crossing. -ipv4 table as1; # Define the tables -ipv4 table as2; +ipv6 table as1; # Define the tables +ipv6 table as2; protocol kernel kern1 { # Synchronize them with the kernel - ipv4 { table as1; export all; }; + ipv6 { table as1; export all; }; kernel table 1; } protocol kernel kern2 { - ipv4 { table as2; export all; }; + ipv6 { table as2; export all; }; kernel table 2; } protocol bgp bgp1 { # The outside connections - ipv4 { table as1; import all; export all; }; + ipv6 { table as1; import all; export all; }; local as 1; - neighbor 192.168.0.1 as 1001; + neighbor 2001:db8::cafe as 1001; } protocol bgp bgp2 { - ipv4 { table as2; import all; export all; }; + ipv6 { table as2; import all; export all; }; local as 2; - neighbor 10.0.0.1 as 1002; + neighbor 2001:db8::beef as 1002; } protocol pipe { # The Pipe table as1; peer table as2; export filter { - if net ~ [ 1.0.0.0/8+] then { # Only AS1 networks + if net ~ [ 3fff:1:/32+ ] then { # Only AS1 networks if preference>10 then preference = preference-10; if source=RTS_BGP then bgp_path.prepend(1); accept; @@ -5471,7 +5493,7 @@ protocol pipe { # The Pipe reject; }; import filter { - if net ~ [ 2.0.0.0/8+] then { # Only AS2 networks + if net ~ [ 3fff:2:/32+ ] then { # Only AS2 networks if preference>10 then preference = preference-10; if source=RTS_BGP then bgp_path.prepend(2); accept; @@ -6105,8 +6127,8 @@ protocol rip [ng] [] {

-protocol rip { - ipv4 { +protocol rip ng { + ipv6 { import all; export all; }; @@ -6311,8 +6333,8 @@ protocol rpki { expire 600; } -filter peer_in_v4 { - if (roa_check(r4, net, bgp_path.last) = ROA_INVALID) then +filter peer_in_v6 { + if (roa_check(r6, net, bgp_path.last) = ROA_INVALID) then { print "Ignore RPKI invalid ", net, " for ASN ", bgp_path.last; reject; @@ -6323,9 +6345,9 @@ filter peer_in_v4 { protocol bgp { debug all; local as 65000; - neighbor 192.168.2.1 as 65001; - ipv4 { - import filter peer_in_v4; + neighbor 2001:db8::cafe as 65001; + ipv6 { + import filter peer_in_v6; export none; }; } @@ -6345,7 +6367,7 @@ protocol rpki { roa4 { table r4; }; roa6 { table r6; }; - remote 127.0.0.1 port 2345; + remote ::1 port 2345; transport ssh { bird private key "/home/birdgeek/.ssh/id_rsa"; remote public key "/home/birdgeek/.ssh/known_hosts"; @@ -6440,7 +6462,7 @@ as the destination becomes adjacent again. (i.e., they can be used multiple times for a route, one time for each nexthop). Syntactically, they are not separate options but just parts of route 10.0.0.0/8 via 192.0.2.1 bfd weight 1 via 192.0.2.2 weight +statement route 3fff:0:1::/48 via 2001:db8::1 bfd weight 1 via 2001:db8::2 weight 2; describes a route with two nexthops, the first nexthop has two per-nexthop options (