documentation:examples:bgp_route_reflector_and_confederation_using_quagga_and_bird
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | documentation:examples:bgp_route_reflector_and_confederation_using_quagga_and_bird [2018/10/22 10:42] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== BGP Route reflector and Confederation using FRRouting and Bird ====== | ||
+ | |||
+ | |||
+ | ===== Presentation ===== | ||
+ | |||
+ | ==== Network diagram ==== | ||
+ | |||
+ | Here is the BGP and logical view: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===== Preparing ===== | ||
+ | |||
+ | This chapter will describe how to start the lab. | ||
+ | |||
+ | |||
+ | ==== Setting-up the lab ==== | ||
+ | |||
+ | See instruction on [[documentation: | ||
+ | ==== Starting the lab ===== | ||
+ | |||
+ | Start this lab with with one of the script corresponding to your needs (vbox, qemu, bhyve) | ||
+ | The output should be like that: | ||
+ | |||
+ | < | ||
+ | root@lab:~ # BSDRP-lab-bhyve.sh -i BSDRP-1.52-full-amd64-serial.img.xz -n 7 -l 1 | ||
+ | BSD Router Project (http:// | ||
+ | Setting-up a virtual envirronement with 7 VM(s): | ||
+ | - Working directory: /tmp/BSDRP | ||
+ | - Each VM have 1 core(s) and 256M RAM | ||
+ | - 1 LAN(s) between all VM | ||
+ | - Full mesh Ethernet links between each VM | ||
+ | VM 1 have the following NIC: | ||
+ | - vtnet0 connected to VM 2. | ||
+ | - vtnet1 connected to VM 3. | ||
+ | - vtnet2 connected to VM 4. | ||
+ | - vtnet3 connected to VM 5. | ||
+ | - vtnet4 connected to VM 6. | ||
+ | - vtnet5 connected to VM 7. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | VM 2 have the following NIC: | ||
+ | - vtnet0 connected to VM 1. | ||
+ | - vtnet1 connected to VM 3. | ||
+ | - vtnet2 connected to VM 4. | ||
+ | - vtnet3 connected to VM 5. | ||
+ | - vtnet4 connected to VM 6. | ||
+ | - vtnet5 connected to VM 7. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | VM 3 have the following NIC: | ||
+ | - vtnet0 connected to VM 1. | ||
+ | - vtnet1 connected to VM 2. | ||
+ | - vtnet2 connected to VM 4. | ||
+ | - vtnet3 connected to VM 5. | ||
+ | - vtnet4 connected to VM 6. | ||
+ | - vtnet5 connected to VM 7. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | VM 4 have the following NIC: | ||
+ | - vtnet0 connected to VM 1. | ||
+ | - vtnet1 connected to VM 2. | ||
+ | - vtnet2 connected to VM 3. | ||
+ | - vtnet3 connected to VM 5. | ||
+ | - vtnet4 connected to VM 6. | ||
+ | - vtnet5 connected to VM 7. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | VM 5 have the following NIC: | ||
+ | - vtnet0 connected to VM 1. | ||
+ | - vtnet1 connected to VM 2. | ||
+ | - vtnet2 connected to VM 3. | ||
+ | - vtnet3 connected to VM 4. | ||
+ | - vtnet4 connected to VM 6. | ||
+ | - vtnet5 connected to VM 7. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | VM 6 have the following NIC: | ||
+ | - vtnet0 connected to VM 1. | ||
+ | - vtnet1 connected to VM 2. | ||
+ | - vtnet2 connected to VM 3. | ||
+ | - vtnet3 connected to VM 4. | ||
+ | - vtnet4 connected to VM 5. | ||
+ | - vtnet5 connected to VM 7. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | VM 7 have the following NIC: | ||
+ | - vtnet0 connected to VM 1. | ||
+ | - vtnet1 connected to VM 2. | ||
+ | - vtnet2 connected to VM 3. | ||
+ | - vtnet3 connected to VM 4. | ||
+ | - vtnet4 connected to VM 5. | ||
+ | - vtnet5 connected to VM 6. | ||
+ | - vtnet6 connected to LAN number 1 | ||
+ | For connecting to VM' | ||
+ | - VM 1 : cu -l /dev/nmdm1B | ||
+ | - VM 2 : cu -l /dev/nmdm2B | ||
+ | - VM 3 : cu -l /dev/nmdm3B | ||
+ | - VM 4 : cu -l /dev/nmdm4B | ||
+ | - VM 5 : cu -l /dev/nmdm5B | ||
+ | - VM 6 : cu -l /dev/nmdm6B | ||
+ | - VM 7 : cu -l /dev/nmdm7B | ||
+ | </ | ||
+ | |||
+ | ===== Routers configuration ===== | ||
+ | |||
+ | All these routers can be configured with labconfig tool (use it only on a lab, because it will replace your current running configuration): | ||
+ | < | ||
+ | labconfig bgp_vm[VM-NUMBER] | ||
+ | </ | ||
+ | ==== Router 1 ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R1 | ||
+ | sysrc ifconfig_vtnet6=" | ||
+ | sysrc ifconfig_vtnet6_ipv6=" | ||
+ | sysrc ifconfig_vtnet0=" | ||
+ | sysrc ifconfig_vtnet0_ipv6=" | ||
+ | hostname R1 | ||
+ | service netif restart | ||
+ | </ | ||
+ | |||
+ | Bird v1.x configuration style: | ||
+ | < | ||
+ | sysrc bird_enable=YES | ||
+ | sysrc bird6_enable=YES | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.101; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel { | ||
+ | export all; | ||
+ | } | ||
+ | |||
+ | # Include device route (warning, a device route is a /32) | ||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected networks | ||
+ | protocol direct { | ||
+ | interface " | ||
+ | } | ||
+ | |||
+ | protocol bgp R2 { | ||
+ | local as 100; | ||
+ | neighbor 10.0.6.2 as 100; | ||
+ | export all; | ||
+ | import all; | ||
+ | } | ||
+ | ' | ||
+ | |||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.101; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel { | ||
+ | export all; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected networks | ||
+ | protocol direct { | ||
+ | interface " | ||
+ | } | ||
+ | |||
+ | protocol bgp R2 { | ||
+ | local as 100; | ||
+ | neighbor 2001: | ||
+ | import all; | ||
+ | export all; | ||
+ | } | ||
+ | ' | ||
+ | |||
+ | service bird start | ||
+ | service bird6 start | ||
+ | </ | ||
+ | |||
+ | Bird v2.x configuration style: | ||
+ | |||
+ | < | ||
+ | sysrc bird_enable=YES | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.101; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel kernel4 { | ||
+ | ipv4 { | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | protocol kernel kernel6 { | ||
+ | ipv6 { | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | # Include device route (warning, a device route is a /32) | ||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected networks | ||
+ | protocol direct { | ||
+ | ipv4; | ||
+ | ipv6; | ||
+ | } | ||
+ | |||
+ | protocol bgp R2inet4 { | ||
+ | local as 100; | ||
+ | neighbor 10.0.6.2 as 100; | ||
+ | ipv4 { | ||
+ | export all; | ||
+ | import all; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol bgp R2inet6 { | ||
+ | local as 100; | ||
+ | neighbor 2001: | ||
+ | ipv6 { | ||
+ | export all; | ||
+ | import all; | ||
+ | }; | ||
+ | } | ||
+ | ' | ||
+ | service bird start | ||
+ | </ | ||
+ | |||
+ | And last save config: | ||
+ | < | ||
+ | config save | ||
+ | </ | ||
+ | ==== Router 2 ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R2 | ||
+ | sysrc ifconfig_vtnet6=" | ||
+ | sysrc ifconfig_vtnet6_ipv6=" | ||
+ | hostname R2 | ||
+ | service netif restart | ||
+ | </ | ||
+ | |||
+ | Bird v1.X configuration style: | ||
+ | < | ||
+ | sysrc bird_enable=YES | ||
+ | sysrc bird6_enable=YES | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.102; | ||
+ | |||
+ | # Define variable | ||
+ | define myas = 100; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel { | ||
+ | export all; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected networks | ||
+ | protocol direct { | ||
+ | interface " | ||
+ | } | ||
+ | |||
+ | protocol bgp R1 { | ||
+ | local as myas; | ||
+ | neighbor 10.0.6.1 as myas; | ||
+ | import all; | ||
+ | export all; | ||
+ | rr client; | ||
+ | } | ||
+ | |||
+ | protocol bgp R3 { | ||
+ | local as myas; | ||
+ | neighbor 10.0.6.3 as myas; | ||
+ | import all; | ||
+ | export all; | ||
+ | rr client; | ||
+ | } | ||
+ | ' | ||
+ | |||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.102; | ||
+ | |||
+ | # Define variable | ||
+ | define myas = 100; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel { | ||
+ | export all; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected network | ||
+ | protocol direct { | ||
+ | interface " | ||
+ | } | ||
+ | |||
+ | protocol bgp R1 { | ||
+ | local as myas; | ||
+ | neighbor 2001: | ||
+ | import all; | ||
+ | export all; | ||
+ | rr client; | ||
+ | } | ||
+ | |||
+ | protocol bgp R3 { | ||
+ | local as myas; | ||
+ | neighbor 2001: | ||
+ | import all; | ||
+ | export all; | ||
+ | rr client; | ||
+ | } | ||
+ | ' | ||
+ | |||
+ | service bird start | ||
+ | service bird6 start | ||
+ | </ | ||
+ | |||
+ | Bird v2.X configuration style: | ||
+ | < | ||
+ | sysrc bird_enable=YES | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.102; | ||
+ | |||
+ | # Define variable | ||
+ | define myas = 100; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel kernel4 { | ||
+ | ipv4 { | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | protocol kernel kernel6 { | ||
+ | ipv6 { | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected networks | ||
+ | protocol direct { | ||
+ | ipv4; | ||
+ | ipv6; | ||
+ | } | ||
+ | |||
+ | protocol bgp R1inet4 { | ||
+ | local as myas; | ||
+ | neighbor 10.0.6.1 as myas; | ||
+ | rr client; | ||
+ | ipv4 { | ||
+ | import all; | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol bgp R3inet4 { | ||
+ | local as myas; | ||
+ | neighbor 10.0.6.3 as myas; | ||
+ | ipv4 { | ||
+ | import all; | ||
+ | export all; | ||
+ | }; | ||
+ | rr client; | ||
+ | } | ||
+ | protocol bgp R1inet6 { | ||
+ | local as myas; | ||
+ | neighbor 2001: | ||
+ | ipv6 { | ||
+ | import all; | ||
+ | export all; | ||
+ | }; | ||
+ | rr client; | ||
+ | } | ||
+ | |||
+ | protocol bgp R3inet6 { | ||
+ | local as myas; | ||
+ | neighbor 2001: | ||
+ | ipv6 { | ||
+ | import all; | ||
+ | export all; | ||
+ | }; | ||
+ | rr client; | ||
+ | } | ||
+ | ' | ||
+ | |||
+ | service bird start | ||
+ | </ | ||
+ | |||
+ | And writing configuration: | ||
+ | < | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | And check that it learn IPv4 route from R1: | ||
+ | |||
+ | < | ||
+ | [root@R2]~# birdc show protocols all R1inet4 | ||
+ | BIRD 2.0.2 ready. | ||
+ | Name | ||
+ | R1inet4 | ||
+ | BGP state: | ||
+ | Neighbor address: 10.0.6.1 | ||
+ | Neighbor AS: 100 | ||
+ | Neighbor ID: 0.0.0.101 | ||
+ | Local capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv4 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Neighbor capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv4 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Session: | ||
+ | Source address: | ||
+ | Hold timer: | ||
+ | Keepalive timer: | ||
+ | Channel ipv4 | ||
+ | State: | ||
+ | Table: | ||
+ | Preference: | ||
+ | Input filter: | ||
+ | Output filter: | ||
+ | Routes: | ||
+ | Route change stats: | ||
+ | Import updates: | ||
+ | Import withdraws: | ||
+ | Export updates: | ||
+ | Export withdraws: | ||
+ | BGP Next hop: | ||
+ | IGP IPv4 table: master4 | ||
+ | |||
+ | |||
+ | [root@R2]~# birdc show route 10.0.1.0/24 | ||
+ | BIRD 2.0.2 ready. | ||
+ | Table master4: | ||
+ | 10.0.1.0/ | ||
+ | via 10.0.6.1 on vtnet6 | ||
+ | </ | ||
+ | |||
+ | And check that it learn IPv6 route from R1: | ||
+ | < | ||
+ | [root@R2]~# birdc show protocols all R1inet6 | ||
+ | BIRD 2.0.2 ready. | ||
+ | Name | ||
+ | R1inet6 | ||
+ | BGP state: | ||
+ | Neighbor address: 2001: | ||
+ | Neighbor AS: 100 | ||
+ | Neighbor ID: 0.0.0.101 | ||
+ | Local capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv6 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Neighbor capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv6 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Session: | ||
+ | Source address: | ||
+ | Hold timer: | ||
+ | Keepalive timer: | ||
+ | Channel ipv6 | ||
+ | State: | ||
+ | Table: | ||
+ | Preference: | ||
+ | Input filter: | ||
+ | Output filter: | ||
+ | Routes: | ||
+ | Route change stats: | ||
+ | Import updates: | ||
+ | Import withdraws: | ||
+ | Export updates: | ||
+ | Export withdraws: | ||
+ | BGP Next hop: | ||
+ | IGP IPv6 table: master6 | ||
+ | |||
+ | [root@R2]~# birdcl show route 2001: | ||
+ | BIRD 2.0.2 ready. | ||
+ | Table master6: | ||
+ | 2001: | ||
+ | via 2001: | ||
+ | </ | ||
+ | ==== Router 3 ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R3 | ||
+ | sysrc ifconfig_vtnet6=" | ||
+ | sysrc ifconfig_vtnet6_ipv6=" | ||
+ | sysrc ifconfig_vtnet2=" | ||
+ | sysrc ifconfig_vtnet2_ipv6=" | ||
+ | hostname R3 | ||
+ | service netif restart | ||
+ | </ | ||
+ | |||
+ | Bird v1.x configuration style: | ||
+ | < | ||
+ | sysrc bird_enable=YES | ||
+ | sysrc bird6_enable=YES | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.103; | ||
+ | |||
+ | # Define variable | ||
+ | define myas = 100; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel { | ||
+ | export all; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected network | ||
+ | protocol direct { | ||
+ | interface " | ||
+ | } | ||
+ | |||
+ | protocol bgp R2 { | ||
+ | local as myas; | ||
+ | neighbor 10.0.6.2 as myas; | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | } | ||
+ | |||
+ | protocol bgp R4 { | ||
+ | local as myas; | ||
+ | # Bird creates IPSEC SAD entry automatically but it need to know the source IP address | ||
+ | # Otherwise it will use the wrong 0.0.0.0 IP as source | ||
+ | source address 10.0.2.3; | ||
+ | neighbor 10.0.2.4 as 200; | ||
+ | password " | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | } | ||
+ | ' | ||
+ | |||
+ | service bird start | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.103; | ||
+ | |||
+ | # Define variable | ||
+ | define myas = 100; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel { | ||
+ | export all; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected network | ||
+ | protocol direct { | ||
+ | interface " | ||
+ | } | ||
+ | |||
+ | protocol bgp R2 { | ||
+ | local as myas; | ||
+ | neighbor 2001: | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | } | ||
+ | |||
+ | protocol bgp R4 { | ||
+ | local as myas; | ||
+ | # Bird creates IPSEC SAD entry automatically but it need to know the source IP address | ||
+ | # Otherwise it will use the wrong :: IP as source | ||
+ | source address 2001: | ||
+ | neighbor 2001: | ||
+ | password " | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | } | ||
+ | ' | ||
+ | service bird6 start | ||
+ | </ | ||
+ | |||
+ | bird v2 configuration style: | ||
+ | < | ||
+ | sysrc bird_enable=YES | ||
+ | cat > / | ||
+ | # Configure logging | ||
+ | log syslog all; | ||
+ | log "/ | ||
+ | log stderr all; | ||
+ | |||
+ | # Override router ID | ||
+ | router id 0.0.0.103; | ||
+ | |||
+ | # Define variable | ||
+ | define myas = 100; | ||
+ | |||
+ | # Sync bird routing table with kernel | ||
+ | protocol kernel kernel4 { | ||
+ | ipv4 { | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | protocol kernel kernel6 { | ||
+ | ipv6 { | ||
+ | export all; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol device { | ||
+ | scan time 10; | ||
+ | } | ||
+ | |||
+ | # Include directly connected networks | ||
+ | protocol direct { | ||
+ | ipv4; | ||
+ | ipv6; | ||
+ | } | ||
+ | |||
+ | protocol bgp R2inet4 { | ||
+ | local as myas; | ||
+ | neighbor 10.0.6.2 as myas; | ||
+ | ipv4 { | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol bgp R4inet4 { | ||
+ | local as myas; | ||
+ | # Bird creates IPSEC SAD entry automatically but it need to know the source IP address | ||
+ | # Otherwise it will use the wrong 0.0.0.0 IP as source | ||
+ | source address 10.0.2.3; | ||
+ | neighbor 10.0.2.4 as 200; | ||
+ | password " | ||
+ | ipv4 { | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol bgp R2inet6 { | ||
+ | local as myas; | ||
+ | neighbor 2001: | ||
+ | ipv6 { | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | protocol bgp R4inet6 { | ||
+ | local as myas; | ||
+ | # Bird creates IPSEC SAD entry automatically but it need to know the source IP address | ||
+ | # Otherwise it will use the wrong :: IP as source | ||
+ | source address 2001: | ||
+ | neighbor 2001: | ||
+ | password " | ||
+ | ipv6 { | ||
+ | import all; | ||
+ | export all; | ||
+ | next hop self; | ||
+ | }; | ||
+ | } | ||
+ | EOF | ||
+ | service bird start | ||
+ | </ | ||
+ | |||
+ | And write configuration: | ||
+ | < | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | And check that it learn IPv4 route: | ||
+ | |||
+ | < | ||
+ | [root@R3]~# birdcl show protocols all R2inet4 | ||
+ | BIRD 2.0.2 ready. | ||
+ | Name | ||
+ | R2inet4 | ||
+ | BGP state: | ||
+ | Neighbor address: 10.0.6.2 | ||
+ | Neighbor AS: 100 | ||
+ | Neighbor ID: 0.0.0.102 | ||
+ | Local capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv4 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Neighbor capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv4 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Session: | ||
+ | Source address: | ||
+ | Hold timer: | ||
+ | Keepalive timer: | ||
+ | Channel ipv4 | ||
+ | State: | ||
+ | Table: | ||
+ | Preference: | ||
+ | Input filter: | ||
+ | Output filter: | ||
+ | Routes: | ||
+ | Route change stats: | ||
+ | Import updates: | ||
+ | Import withdraws: | ||
+ | Export updates: | ||
+ | Export withdraws: | ||
+ | BGP Next hop: | ||
+ | IGP IPv4 table: master4 | ||
+ | |||
+ | [root@R3]~# birdcl show route 10.0.1.0/24 | ||
+ | BIRD 2.0.2 ready. | ||
+ | Table master4: | ||
+ | 10.0.1.0/ | ||
+ | via 10.0.6.1 on vtnet6 | ||
+ | </ | ||
+ | |||
+ | and check that it learn IPv6 route: | ||
+ | < | ||
+ | [root@R3]~# birdc show protocols all R2inet6 | ||
+ | BIRD 2.0.2 ready. | ||
+ | Name | ||
+ | R2inet6 | ||
+ | BGP state: | ||
+ | Neighbor address: 2001: | ||
+ | Neighbor AS: 100 | ||
+ | Neighbor ID: 0.0.0.102 | ||
+ | Local capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv6 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Neighbor capabilities | ||
+ | Multiprotocol | ||
+ | AF announced: ipv6 | ||
+ | Route refresh | ||
+ | Graceful restart | ||
+ | 4-octet AS numbers | ||
+ | Enhanced refresh | ||
+ | Session: | ||
+ | Source address: | ||
+ | Hold timer: | ||
+ | Keepalive timer: | ||
+ | Channel ipv6 | ||
+ | State: | ||
+ | Table: | ||
+ | Preference: | ||
+ | Input filter: | ||
+ | Output filter: | ||
+ | Routes: | ||
+ | Route change stats: | ||
+ | Import updates: | ||
+ | Import withdraws: | ||
+ | Export updates: | ||
+ | Export withdraws: | ||
+ | BGP Next hop: | ||
+ | IGP IPv6 table: master6 | ||
+ | |||
+ | [root@R3]~# birdcl show route 2001: | ||
+ | BIRD 2.0.2 ready. | ||
+ | Table master6: | ||
+ | 2001: | ||
+ | via 2001: | ||
+ | </ | ||
+ | ==== Router 4 ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R4 | ||
+ | hostname R4 | ||
+ | sysrc frr_enable=YES | ||
+ | sysrc ipsec_enable=YES | ||
+ | sysrc ipsec_file="/ | ||
+ | service frr start | ||
+ | cat <<EOF > / | ||
+ | flush ; | ||
+ | add 10.0.2.3 10.0.2.4 tcp 0x1000 -A tcp-md5 " | ||
+ | add 10.0.2.4 10.0.2.3 tcp 0x1001 -A tcp-md5 " | ||
+ | add -6 2001: | ||
+ | add -6 2001: | ||
+ | EOF | ||
+ | service ipsec start | ||
+ | cli | ||
+ | conf t | ||
+ | interface vtnet2 | ||
+ | ip address 10.0.2.4/24 | ||
+ | ipv6 address 2001: | ||
+ | interface vtnet3 | ||
+ | ip address 10.0.3.4/24 | ||
+ | ipv6 address 2001: | ||
+ | router bgp 64512 | ||
+ | bgp router-id 0.0.0.204 | ||
+ | bgp confederation identifier 200 | ||
+ | bgp confederation peers 65535 | ||
+ | no bgp default ipv4-unicast | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | network 10.0.3.0/24 | ||
+ | neighbor 10.0.3.5 activate | ||
+ | neighbor 10.0.3.5 next-hop-self | ||
+ | neighbor 10.0.2.3 activate | ||
+ | no neighbor 2001: | ||
+ | no neighbor 2001: | ||
+ | | ||
+ | | ||
+ | network 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | | ||
+ | exit | ||
+ | exit | ||
+ | wr | ||
+ | exit | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | Check that BGP IPv4 and IPV6 peers are UP between R4 and R3: | ||
+ | |||
+ | < | ||
+ | [root@R4]~# cli | ||
+ | |||
+ | Hello, this is FRRouting (version 6.0). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | R4# sh bgp summary | ||
+ | |||
+ | IPv4 Unicast Summary: | ||
+ | BGP router identifier 0.0.0.204, local AS number 64512 vrf-id 0 | ||
+ | BGP table version 5 | ||
+ | RIB entries 9, using 1440 bytes of memory | ||
+ | Peers 4, using 54 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 10.0.2.3 | ||
+ | 10.0.3.5 | ||
+ | |||
+ | Total number of neighbors 2 | ||
+ | |||
+ | IPv6 Unicast Summary: | ||
+ | BGP router identifier 0.0.0.204, local AS number 64512 vrf-id 0 | ||
+ | BGP table version 7 | ||
+ | RIB entries 13, using 2080 bytes of memory | ||
+ | Peers 4, using 54 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 2001: | ||
+ | 2001: | ||
+ | |||
+ | Total number of neighbors 2 | ||
+ | </ | ||
+ | |||
+ | And check that R4 learn the IPv4/IPv6 routes from AS100: | ||
+ | |||
+ | < | ||
+ | R4# show ip route 10.0.1.0/24 | ||
+ | Routing entry for 10.0.1.0/24 | ||
+ | Known via " | ||
+ | Last update 00:03:26 ago | ||
+ | * 10.0.2.3, via vtnet2 | ||
+ | |||
+ | R4# show ipv6 route 2001: | ||
+ | Routing entry for 2001: | ||
+ | Known via " | ||
+ | Last update 00:03:34 ago | ||
+ | * fe80:: | ||
+ | </ | ||
+ | ==== Router 5 ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R5 | ||
+ | sysrc frr_enable=YES | ||
+ | hostname R5 | ||
+ | service frr start | ||
+ | cli | ||
+ | conf t | ||
+ | interface vtnet3 | ||
+ | ip address 10.0.3.5/24 | ||
+ | ipv6 address 2001: | ||
+ | interface vtnet4 | ||
+ | ip address 10.0.4.5/24 | ||
+ | ipv6 address 2001: | ||
+ | router bgp 64512 | ||
+ | bgp router-id 0.0.0.205 | ||
+ | bgp confederation identifier 200 | ||
+ | bgp confederation peers 65535 | ||
+ | no bgp default ipv4-unicast | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | network 10.0.3.0/24 | ||
+ | network 10.0.4.0/24 | ||
+ | neighbor 10.0.3.4 activate | ||
+ | neighbor 10.0.3.4 next-hop-self | ||
+ | neighbor 10.0.4.6 activate | ||
+ | neighbor 10.0.4.6 next-hop-self | ||
+ | no neighbor 2001: | ||
+ | no neighbor 2001: | ||
+ | | ||
+ | | ||
+ | network 2001: | ||
+ | network 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | | ||
+ | exit | ||
+ | exit | ||
+ | wr | ||
+ | exit | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | Check that BGP IPv4 and IPV6 peers are UP between R5 and R4: | ||
+ | |||
+ | < | ||
+ | [root@R5]~# cli | ||
+ | |||
+ | Hello, this is FRRouting (version 2.0). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | R5# sh ip bgp summary | ||
+ | BGP router identifier 0.0.0.205, local AS number 64512 vrf-id 0 | ||
+ | BGP table version 5 | ||
+ | RIB entries 9, using 1080 bytes of memory | ||
+ | Peers 4, using 53 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 10.0.3.4 | ||
+ | 10.0.4.6 | ||
+ | |||
+ | Total number of neighbors 2 | ||
+ | |||
+ | R5# sh ipv6 bgp summary | ||
+ | BGP router identifier 0.0.0.205, local AS number 64512 vrf-id 0 | ||
+ | BGP table version 2 | ||
+ | RIB entries 9, using 1080 bytes of memory | ||
+ | Peers 4, using 53 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 2001: | ||
+ | 2001: | ||
+ | |||
+ | Total number of neighbors 2 | ||
+ | </ | ||
+ | |||
+ | And check that R5 learn the IPv4/IPv6 routes advertised by R4 from AS100: | ||
+ | |||
+ | < | ||
+ | R5# show ip route 10.0.1.0/24 | ||
+ | Routing entry for 10.0.1.0/24 | ||
+ | Known via " | ||
+ | Last update 00:01:43 ago | ||
+ | * 10.0.3.4, via vtnet3 | ||
+ | |||
+ | R5# show ipv6 route 2001: | ||
+ | Routing entry for 2001: | ||
+ | Known via " | ||
+ | Last update 00:00:11 ago | ||
+ | * 2001: | ||
+ | </ | ||
+ | ==== Router 6 ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R6 | ||
+ | hostname R6 | ||
+ | sysrc ipsec_enable=YES | ||
+ | sysrc ipsec_file="/ | ||
+ | sysrc frr_enable=YES | ||
+ | service frr start | ||
+ | cat <<EOF > / | ||
+ | flush ; | ||
+ | add 10.0.5.6 10.0.5.7 tcp 0x1000 -A tcp-md5 " | ||
+ | add 10.0.5.7 10.0.5.6 tcp 0x1001 -A tcp-md5 " | ||
+ | add -6 2001: | ||
+ | add -6 2001: | ||
+ | EOF | ||
+ | service ipsec start | ||
+ | cli | ||
+ | conf t | ||
+ | interface vtnet4 | ||
+ | ip address 10.0.4.6/24 | ||
+ | ipv6 address 2001: | ||
+ | interface vtnet5 | ||
+ | ip address 10.0.5.6/24 | ||
+ | ipv6 address 2001: | ||
+ | router bgp 65535 | ||
+ | bgp router-id 0.0.0.206 | ||
+ | bgp confederation identifier 200 | ||
+ | bgp confederation peers 64512 | ||
+ | no bgp default ipv4-unicast | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | network 10.0.5.0/24 | ||
+ | neighbor 10.0.4.5 activate | ||
+ | neighbor 10.0.4.5 next-hop-self | ||
+ | neighbor 10.0.5.7 activate | ||
+ | neighbor 10.0.5.7 next-hop-self | ||
+ | no neighbor 2001: | ||
+ | no neighbor 2001: | ||
+ | | ||
+ | | ||
+ | network 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | neighbor 2001: | ||
+ | | ||
+ | exit | ||
+ | exit | ||
+ | wr | ||
+ | exit | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | Check that BGP IPv4 and IPV6 peers are UP between R6 and R5: | ||
+ | |||
+ | < | ||
+ | [root@R6]~# cli | ||
+ | |||
+ | Hello, this is FRRouting (version 6.0). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | R6# sh bgp summary | ||
+ | |||
+ | IPv4 Unicast Summary: | ||
+ | BGP router identifier 0.0.0.206, local AS number 65535 vrf-id 0 | ||
+ | BGP table version 7 | ||
+ | RIB entries 13, using 2080 bytes of memory | ||
+ | Peers 4, using 54 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 10.0.4.5 | ||
+ | 10.0.5.7 | ||
+ | |||
+ | Total number of neighbors 2 | ||
+ | |||
+ | IPv6 Unicast Summary: | ||
+ | BGP router identifier 0.0.0.206, local AS number 65535 vrf-id 0 | ||
+ | BGP table version 7 | ||
+ | RIB entries 13, using 2080 bytes of memory | ||
+ | Peers 4, using 54 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 2001: | ||
+ | 2001: | ||
+ | |||
+ | Total number of neighbors 2 | ||
+ | </ | ||
+ | |||
+ | And check that R6 learn the IPv4/IPv6 routes advertised by R5: | ||
+ | |||
+ | < | ||
+ | R6# sh ip route 10.0.1.0/24 | ||
+ | Routing entry for 10.0.1.0/24 | ||
+ | Known via " | ||
+ | Last update 00:01:10 ago | ||
+ | * 10.0.4.5, via vtnet4 | ||
+ | |||
+ | R6# sh ipv6 route 2001: | ||
+ | Routing entry for 2001: | ||
+ | Known via " | ||
+ | Last update 00:01:17 ago | ||
+ | * 2001: | ||
+ | </ | ||
+ | ==== Router 7 ==== | ||
+ | Configure router hostname and ipsec.conf for the BGP TCP-MD5 session: | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R7 | ||
+ | hostname R7 | ||
+ | sysrc ipsec_enable=YES | ||
+ | sysrc ipsec_file="/ | ||
+ | sysrc frr_enable=YES | ||
+ | service frr start | ||
+ | cat <<EOF > / | ||
+ | flush ; | ||
+ | add 10.0.5.6 10.0.5.7 tcp 0x1000 -A tcp-md5 " | ||
+ | add 10.0.5.7 10.0.5.6 tcp 0x1001 -A tcp-md5 " | ||
+ | add -6 2001: | ||
+ | add -6 2001: | ||
+ | EOF | ||
+ | service ipsec start | ||
+ | cli | ||
+ | conf t | ||
+ | interface vtnet0 | ||
+ | ip address 10.0.7.7/24 | ||
+ | ipv6 address 2001: | ||
+ | interface vtnet5 | ||
+ | ip address 10.0.5.7/24 | ||
+ | ipv6 address 2001: | ||
+ | router bgp 65535 | ||
+ | bgp router-id 0.0.0.207 | ||
+ | bgp confederation identifier 200 | ||
+ | bgp confederation peers 64512 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | network 10.0.5.0/24 | ||
+ | network 10.0.7.0/24 | ||
+ | neighbor 10.0.5.6 activate | ||
+ | no neighbor 2001: | ||
+ | exit-address-family | ||
+ | | ||
+ | network 2001: | ||
+ | network 2001: | ||
+ | neighbor 2001: | ||
+ | exit-address-family | ||
+ | exit | ||
+ | exit | ||
+ | wr | ||
+ | exit | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | Check that BGP IPv4 and IPV6 peers are UP between R7 and R6: | ||
+ | |||
+ | < | ||
+ | [root@R7]~# cli | ||
+ | |||
+ | Hello, this is FRRouting (version 6.0). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | R7# show bgp summary | ||
+ | R7# sh bgp summary | ||
+ | |||
+ | IPv4 Unicast Summary: | ||
+ | BGP router identifier 0.0.0.207, local AS number 65535 vrf-id 0 | ||
+ | BGP table version 7 | ||
+ | RIB entries 13, using 2080 bytes of memory | ||
+ | Peers 2, using 27 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 10.0.5.6 | ||
+ | |||
+ | Total number of neighbors 1 | ||
+ | |||
+ | IPv6 Unicast Summary: | ||
+ | BGP router identifier 0.0.0.207, local AS number 65535 vrf-id 0 | ||
+ | BGP table version 7 | ||
+ | RIB entries 13, using 2080 bytes of memory | ||
+ | Peers 2, using 27 KiB of memory | ||
+ | |||
+ | Neighbor | ||
+ | 2001: | ||
+ | |||
+ | Total number of neighbors 1 | ||
+ | </ | ||
+ | |||
+ | And check that R7 learns the IPv4/IPv6 routes advertised by R6: | ||
+ | |||
+ | < | ||
+ | R7# show ip route 10.0.1.0/24 | ||
+ | Routing entry for 10.0.1.0/24 | ||
+ | Known via " | ||
+ | Last update 00:01:26 ago | ||
+ | * 10.0.5.6, via vtnet5 | ||
+ | |||
+ | R7# show ipv6 route 2001: | ||
+ | Routing entry for 2001: | ||
+ | Known via " | ||
+ | Last update 00:01:29 ago | ||
+ | * 2001: | ||
+ | </ | ||
+ | ===== Final testing ===== | ||
+ | |||
+ | Verifying route between from R7 to R1 using source IP 10.0.7.7/ | ||
+ | |||
+ | < | ||
+ | R7# exit | ||
+ | [root@R7]~# traceroute -s 10.0.7.7 10.0.1.1 | ||
+ | traceroute to 10.0.1.1 (10.0.1.1) from 10.0.7.7, 64 hops max, 52 byte packets | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@R7]~# traceroute6 -s 2001: | ||
+ | traceroute6 to 2001: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
documentation/examples/bgp_route_reflector_and_confederation_using_quagga_and_bird.txt · Last modified: 2021/03/22 21:15 by olivier