User Tools

Site Tools


documentation:examples:bgp_route_reflector_and_confederation_using_quagga_and_bird

BGP Route reflector and Confederation using Quagga 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 How to build a BSDRP router lab.

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://bsdrp.net) - bhyve full-meshed lab script
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'serial console, you can use:
- 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

Router 1

Configure hostname, disable Quagga and Enable Bird, edit /etc/rc.conf

sysrc hostname=R1
sysrc ifconfig_vtnet6="10.0.6.1/24"
sysrc ifconfig_vtnet6_ipv6="inet6 2001:db8:6::1 prefixlen 64"
sysrc ifconfig_vtnet0="10.0.1.1/24"
sysrc ifconfig_vtnet0_ipv6="inet6 2001:db8:1::1 prefixlen 64"
sysrc quagga_enable=NO
sysrc bird_enable=YES
sysrc bird6_enable=YES

Then apply changes:

hostname R1
service quagga stop
service netif restart

Create the bird IPv4 configuration file:

cat > /usr/local/etc/bird.conf <<'EOF'
# Configure logging
log syslog all;
log "/var/log/bird.log" all;
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 "vtnet0","vtnet6";
}

protocol bgp R2 {
        local as 100;
        neighbor 10.0.6.2 as 100;
        export all;
        import all;
}
'EOF'

Now start bird process :

service bird start

Create IPv6 bird configuraton file:

cat > /usr/local/etc/bird6.conf <<'EOF'
# Configure logging
log syslog all;
log "/var/log/bird6.log" all;
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 "vtnet0","vtnet6";
}

protocol bgp R2 {
        local as 100;
        neighbor 2001:db8:6::2 as 100;
        import all;
        export all;
}
'EOF'

Start bird IPv6 process:

service bird6 start

Save configuration:

config save

Router 2

Configure hostname, disable Quagga and Enable Bird, edit /etc/rc.conf

sysrc hostname=R2
sysrc ifconfig_vtnet6="10.0.6.2/24"
sysrc ifconfig_vtnet6_ipv6="inet6 2001:db8:6::2 prefixlen 64"
sysrc quagga_enable=NO
sysrc bird_enable=YES
sysrc bird6_enable=YES

Then apply changes:

hostname R2
service quagga stop
service netif restart

Create Bird IPv4 configuration file /usr/local/etc/bird.conf with these lines in:

cat > /usr/local/etc/bird.conf <<'EOF'
# Configure logging
log syslog all;
log "/var/log/bird.log" all;
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 "vtnet6";
}

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;
}
'EOF'

Now start bird process:

service bird start

And check that it learn IPv4 route from R1:

[root@R2]~# birdc show protocols all R1
BIRD 1.4.4 ready.
name     proto    table    state  since       info
R1       BGP      master   up     16:09:01    Established
  Preference:     100
  Input filter:   ACCEPT
  Output filter:  ACCEPT
  Routes:         2 imported, 1 exported, 1 preferred
  Route change stats:     received   rejected   filtered    ignored   accepted
    Import updates:              2          0          0          0          2
    Import withdraws:            0          0        ---          0          0
    Export updates:              2          1          0        ---          1
    Export withdraws:            0        ---        ---        ---          0
  BGP state:          Established
    Neighbor address: 10.0.6.1
    Neighbor AS:      100
    Neighbor ID:      0.0.0.101
    Neighbor caps:    refresh restart-aware AS4
    Session:          internal multihop route-reflector AS4
    Source address:   10.0.6.2
    Hold timer:       207/240
    Keepalive timer:  58/80


[root@R2]~# birdc show route 10.0.1.0/24
BIRD 1.4.4 ready.
10.0.1.0/24        via 10.0.6.1 on vtnet6 [R1 16:09:00] * (100/0) [i]

Now create IPv6 bird configuration file:

cat > /usr/local/etc/bird6.conf <<'EOF'
# Configure logging
log syslog all;
log "/var/log/bird6.log" all;
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 "vtnet6";
}

protocol bgp R1 {
        local as myas;
        neighbor 2001:db8:6::1 as myas;
        import all;
        export all;
        rr client;
}

protocol bgp R3 {
        local as myas;
        neighbor 2001:db8:6::3 as myas;
        import all;
        export all;
        rr client;
}
'EOF'

Now start bird IPv6 process:

service bird6 start

And check that it learn IPv6 route from R1:

[root@R2]~# birdcl6 show protocols all R1
BIRD 1.4.4 ready.
name     proto    table    state  since       info
R1       BGP      master   up     16:13:18    Established
  Preference:     100
  Input filter:   ACCEPT
  Output filter:  ACCEPT
  Routes:         2 imported, 1 exported, 1 preferred
  Route change stats:     received   rejected   filtered    ignored   accepted
    Import updates:              2          0          0          0          2
    Import withdraws:            0          0        ---          0          0
    Export updates:              2          1          0        ---          1
    Export withdraws:            0        ---        ---        ---          0
  BGP state:          Established
    Neighbor address: 2001:db8:6::1
    Neighbor AS:      100
    Neighbor ID:      0.0.0.101
    Neighbor caps:    refresh restart-aware AS4
    Session:          internal multihop route-reflector AS4
    Source address:   2001:db8:6::2
    Hold timer:       206/240
    Keepalive timer:  59/80

[root@R2]~# birdcl6 show route 2001:db8:1::/64
BIRD 1.4.4 ready.
2001:db8:1::/64    via 2001:db8:6::1 on vtnet6 [R1 16:13:18] * (100/0) [i]

Save configuration:

config save

Router 3

Configure hostname, disable Quagga and Enable Bird:

sysrc hostname=R3
sysrc ifconfig_vtnet6="10.0.6.3/24"
sysrc ifconfig_vtnet6_ipv6="inet6 2001:db8:6::3 prefixlen 64"
sysrc ifconfig_vtnet2="10.0.2.3/24"
sysrc ifconfig_vtnet2_ipv6="inet6 2001:db8:2::3 prefixlen 64"
sysrc quagga_enable=NO
sysrc bird_enable=YES
sysrc bird6_enable=YES
sysrc ipsec_enable=YES
sysrc ipsec_file="/etc/ipsec.conf"

And create the ipsec.conf for the BGP TCP-MD5 session:

cat <<EOF > /etc/ipsec.conf
flush ;
add 10.0.2.3 10.0.2.4 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add 10.0.2.4 10.0.2.3 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:2::3 2001:db8:2::4 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:2::4 2001:db8:2::3 tcp 0x1000 -A tcp-md5 "abigpassword" ;
EOF

Then apply changes:

hostname R3
service quagga stop
service netif restart
service ipsec start

Then configure bird:

cat > /usr/local/etc/bird.conf <<'EOF'
# Configure logging
log syslog all;
log "/var/log/bird.log" all;
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 "vtnet6","vtnet2";
}

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;
        neighbor 10.0.2.4 as 200;
        password "abigpassword";
        import all;
        export all;
        next hop self;
}
'EOF'

Now start bird process:

[root@R3]~#service bird start

And check that it learn IPv4 route:

[root@R3]~# birdcl show protocols all R2
BIRD 1.4.4 ready.
name     proto    table    state  since       info
R2       BGP      master   up     16:17:49    Established
  Preference:     100
  Input filter:   ACCEPT
  Output filter:  ACCEPT
  Routes:         2 imported, 2 exported, 1 preferred
  Route change stats:     received   rejected   filtered    ignored   accepted
    Import updates:              2          0          0          0          2
    Import withdraws:            0          0        ---          0          0
    Export updates:              3          1          0        ---          2
    Export withdraws:            0        ---        ---        ---          0
  BGP state:          Established
    Neighbor address: 10.0.6.2
    Neighbor AS:      100
    Neighbor ID:      0.0.0.102
    Neighbor caps:    refresh restart-aware AS4
    Session:          internal multihop AS4
    Source address:   10.0.6.3
    Hold timer:       223/240
    Keepalive timer:  44/80

[root@R3]~# birdcl show route 10.0.1.0/24
BIRD 1.4.4 ready.
10.0.1.0/24        via 10.0.6.1 on vtnet6 [R2 16:17:50 from 10.0.6.2] * (100/0) [i]

Now configure IPv6 bird process:

cat > /usr/local/etc/bird6.conf <<'EOF'
# Configure logging
log syslog all;
log "/var/log/bird6.log" all;
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 "vtnet6","vtnet2";
}

protocol bgp R2 {
        local as myas;
        neighbor 2001:db8:6::2 as myas;
        import all;
        export all;
        next hop self;
}

protocol bgp R4 {
        local as myas;
        neighbor 2001:db8:2::4 as 200;
        import all;
        export all;
        next hop self;
}
'EOF'

Now start bird IPv6 process and check that it learn IPv6 route:

[root@R3]~#service bird6 start
Starting bird.
[root@R3]~# birdc6 show protocols all R2
BIRD 1.4.4 ready.
name     proto    table    state  since       info
R2       BGP      master   up     16:23:39    Established
  Preference:     100
  Input filter:   ACCEPT
  Output filter:  ACCEPT
  Routes:         2 imported, 0 exported, 2 preferred
  Route change stats:     received   rejected   filtered    ignored   accepted
    Import updates:              2          0          0          0          2
    Import withdraws:            0          0        ---          0          0
    Export updates:              2          2          0        ---          0
    Export withdraws:            0        ---        ---        ---          0
  BGP state:          Established
    Neighbor address: 2001:db8:6::2
    Neighbor AS:      100
    Neighbor ID:      0.0.0.102
    Neighbor caps:    refresh restart-aware AS4
    Session:          internal multihop AS4
    Source address:   2001:db8:6::3
    Hold timer:       179/240
    Keepalive timer:  66/80

[root@R3]~# birdcl6 show route 2001:db8:1::/64
BIRD 1.4.4 ready.
2001:db8:1::/64    via 2001:db8:6::1 on vtnet6 [R2 16:28:12 from 2001:db8:6::2] * (100/0) [i]

Save configuration:

config save

Router 4

Configure router hostname:

sysrc hostname=R4
hostname R4
sysrc ipsec_enable=YES
sysrc ipsec_file="/etc/ipsec.conf"

And create the ipsec.conf for the BGP TCP-MD5 session:

cat <<EOF > /etc/ipsec.conf
flush ;
add 10.0.2.3 10.0.2.4 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add 10.0.2.4 10.0.2.3 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:2::3 2001:db8:2::4 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:2::4 2001:db8:2::3 tcp 0x1000 -A tcp-md5 "abigpassword" ;
EOF
service ipsec start

Enter in Quagga configuration (vtysh) and configure IP addresses and BGP:

cli
conf t
interface vtnet2
 ip address 10.0.2.4/24
 ipv6 address 2001:db8:2::4/64
interface vtnet3
 ip address 10.0.3.4/24
 ipv6 address 2001:db8:3::4/64
exit
router bgp 64512
 bgp router-id 204
 bgp confederation identifier 200
 bgp confederation peers 65535
 network 10.0.3.0/24
 neighbor 10.0.2.3 remote-as 100
 neighbor 10.0.2.3 password abigpassword
 neighbor 10.0.3.5 remote-as 64512
 neighbor 10.0.3.5 next-hop-self 
 no synchronization 
 neighbor 2001:db8:3::5 remote-as 64512
 neighbor 2001:db8:3::5 next-hop-self
 no neighbor 2001:db8:3::5 activate
 neighbor 2001:db8:2::3 remote-as 100
 no neighbor 2001:db8:2::3 activate
 neighbor 2001:db8:2::3 password abigpassword
 address-family ipv6
  network 2001:db8:3::/64
  neighbor 2001:db8:3::5 activate
  neighbor 2001:db8:2::3 activate
  exit
 exit
exit
wr

Check that BGP IPv4 and IPV6 peers are UP between R4 and R3:

R4# sh ip bgp summary
BGP router identifier 0.0.0.204, local AS number 64512
RIB entries 7, using 784 bytes of memory
Peers 4, using 18 KiB of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.0.2.3        4   100      16      16        0    0    0 00:11:10        3
10.0.3.5        4 64512       0       0        0    0    0 never    Active

Total number of neighbors 2
R4# show ipv6 bgp summary
BGP router identifier 0.0.0.204, local AS number 64512
RIB entries 7, using 784 bytes of memory
Peers 4, using 18 KiB of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2001:db8:2::3   4   100      16      16        0    0    0 00:11:36        3
2001:db8:3::5   4 64512       0       0        0    0    0 never    Active

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 "bgp", distance 20, metric 0, best
  Last update 00:12:22 ago
  * 10.0.2.3, via vtnet2

R4# show ipv6 route 2001:db8:1::/64
Routing entry for 2001:db8:1::/64
  Known via "bgp", distance 20, metric 0, best
  Last update 00:12:32 ago
  * fe80::5a9c:fcff:fe03:403, via vtnet2

Save configuration:

exit
config save

Router 5

Configure router hostname:

sysrc hostname=R5
hostname R5

And use Quagga for configuring IP addresses and BGP:

cli
conf t
interface vtnet3            
 ip address 10.0.3.5/24
 ipv6 address 2001:db8:3::5/64
interface vtnet4
 ip address 10.0.4.5/24
 ipv6 address 2001:db8:4::5/64
 exit
router bgp 64512
 bgp router-id 205
 bgp confederation identifier 200      
 bgp confederation peers 65535
 no synchronization
 network 10.0.3.0/24
 neighbor 10.0.3.4 remote-as 64512
 neighbor 10.0.3.4 next-hop-self
 neighbor 10.0.4.6 remote-as 65535
 neighbor 10.0.4.6 next-hop-self
 neighbor 2001:db8:3::4 remote-as 64512 
 no neighbor 2001:db8:3::4 activate  
 neighbor 2001:db8:4::6 remote-as 65535
 no neighbor 2001:db8:4::6 activate 
 address-family ipv6 
   network 2001:db8:3::/64              
   neighbor 2001:db8:3::4 activate
   neighbor 2001:db8:3::4 next-hop-self
   neighbor 2001:db8:4::6 activate
   neighbor 2001:db8:4::6 next-hop-self 
   exit
 exit
exit
wr

Check that BGP IPv4 and IPV6 peers are UP between R5 and R4:

R5# sh ip bgp summary
BGP router identifier 0.0.0.205, local AS number 64512
RIB entries 7, using 784 bytes of memory
Peers 4, using 18 KiB of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.0.3.4        4 64512       3       4        0    0    0 00:00:50        4
10.0.4.6        4 65535       0       0        0    0    0 never    Active

Total number of neighbors 2

R5# sh ipv6 bgp summary
BGP router identifier 0.0.0.205, local AS number 64512
RIB entries 7, using 784 bytes of memory
Peers 4, using 18 KiB of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2001:db8:3::4   4 64512       8       7        0    0    0 00:03:18        4
2001:db8:4::6   4 65535       0       0        0    0    0 never    Active

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 "bgp", distance 200, metric 0, best
  Last update 00:01:43 ago
  * 10.0.3.4, via vtnet3

R5# show ipv6 route 2001:db8:1::/64
Routing entry for 2001:db8:1::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 00:03:59 ago
  * fe80::5a9c:fcff:fe04:504, via vtnet3

Save configuration:

exit
config save

Router 6

Configure router hostname:

sysrc hostname=R6
hostname R6
sysrc ipsec_enable=YES
sysrc ipsec_file="/etc/ipsec.conf"

And create the ipsec.conf for the BGP TCP-MD5 session:

cat <<EOF > /etc/ipsec.conf
flush ;
add 10.0.5.6 10.0.5.7 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
add 10.0.5.7 10.0.5.6 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
add -6 2001:db8:5::6 2001:db8:5::7 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
add -6 2001:db8:5::7 2001:db8:5::6 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
EOF
service ipsec start

Enter in Quagga configuration (vtysh) and configure IP addresses and BGP:

cli
conf t
interface vtnet4
 ip address 10.0.4.6/24
 ipv6 address 2001:db8:4::6/64
interface vtnet5
 ip address 10.0.5.6/24
 ipv6 address 2001:db8:5::6/64
exit
router bgp 65535
 bgp router-id 206
 bgp confederation identifier 200
 bgp confederation peers 64512   
 no synchronization           
 network 10.0.5.0/24
 neighbor 10.0.4.5 remote-as 64512
 neighbor 10.0.4.5 next-hop-self 
 neighbor 10.0.5.7 remote-as 65535
 neighbor 10.0.5.7 next-hop-self
 neighbor 10.0.5.7 password abcdefgh
 neighbor 2001:db8:5::7 remote-as 65535
 no neighbor 2001:db8:5::7 activate
 neighbor 2001:db8:5::7 password abcdefgh
 neighbor 2001:db8:4::5 remote-as 64512    
 no neighbor 2001:db8:4::5 activate
 address-family ipv6
  network 2001:db8:5::/64
  neighbor 2001:db8:4::5 activate
  neighbor 2001:db8:4::5 next-hop-self
  neighbor 2001:db8:5::7 activate
  neighbor 2001:db8:5::7 next-hop-self
  exit
 exit
exit
wr

Check that BGP IPv4 and IPV6 peers are UP between R6 and R5:

R6# sh ip bgp summary
BGP router identifier 0.0.0.206, local AS number 65535
RIB entries 9, using 1008 bytes of memory
Peers 4, using 18 KiB of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.0.4.5        4 64512       4       4        0    0    0 00:00:13        4
10.0.5.7        4 65535       0       0        0    0    0 never    Connect

Total number of neighbors 2

R6# sh ipv6 bgp summary
BGP router identifier 0.0.0.206, local AS number 65535
RIB entries 9, using 1008 bytes of memory
Peers 4, using 18 KiB of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2001:db8:4::5   4 64512       6       4        0    0    0 00:00:42        4
2001:db8:5::7   4 65535       0       0        0    0    0 never    Active

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 "bgp", distance 200, metric 0, best
  Last update 00:01:10 ago
  * 10.0.4.5, via vtnet4

R6# sh ipv6 route 2001:db8:1::/64
Routing entry for 2001:db8:1::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 00:01:17 ago
  * fe80::5a9c:fcff:fe05:605, via vtnet4

Save configuration:

exit
config save

Router 7

Configure router hostname:

sysrc hostname=R7
hostname R7
sysrc ipsec_enable=YES
sysrc ipsec_file="/etc/ipsec.conf"

And create the ipsec.conf for the BGP TCP-MD5 session:

cat <<EOF > /etc/ipsec.conf
flush ;
add 10.0.5.6 10.0.5.7 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
add 10.0.5.7 10.0.5.6 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
add -6 2001:db8:5::6 2001:db8:5::7 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
add -6 2001:db8:5::7 2001:db8:5::6 tcp 0x1000 -A tcp-md5 "abcdefgh" ;
EOF
service ipsec start

Enter in Quagga configuration (vtysh) and configure IP addresses and BGP:

cli
conf t
interface vtnet5
 ip address 10.0.5.7/24
 ipv6 address 2001:db8:5::7/64
interface vtnet0
 ip address 10.0.7.7/24
 ipv6 address 2001:db8:7::7/64
 exit
router bgp 65535
 bgp router-id 207
 bgp confederation identifier 200
 bgp confederation peers 64512
 no synchronization 
 network 10.0.5.0/24
 network 10.0.7.0/24
 neighbor 10.0.5.6 remote-as 65535
 neighbor 10.0.5.6 password abcdefgh
 neighbor 2001:db8:5::6 remote-as 65535
 no neighbor 2001:db8:5::6 activate 
 neighbor 2001:db8:5::6 password abcdefgh
 address-family ipv6
  network 2001:db8:7::/64
  network 2001:db8:5::/64
  neighbor 2001:db8:5::6 activate
  exit     
 exit
exit
wr

Check that BGP IPv4 and IPV6 peers are UP between R7 and R6:

R7# show ip bgp summary
BGP router identifier 0.0.0.207, local AS number 65535
RIB entries 11, using 1056 bytes of memory
Peers 2, using 9120 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.0.5.6        4 65535       6       5        0    0    0 00:01:01        5

Total number of neighbors 1
R7# show ipv6 bgp summary
BGP router identifier 0.0.0.207, local AS number 65535
RIB entries 11, using 1056 bytes of memory
Peers 2, using 9120 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2001:db8:5::6   4 65535       8       8        0    0    0 00:00:08        5

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 "bgp", distance 200, metric 0, best
  Last update 00:01:26 ago
  * 10.0.5.6, via vtnet5

R7# show ipv6 route 2001:db8:1::/64
Routing entry for 2001:db8:1::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 00:00:44 ago
  * fe80::a8aa:ff:fe00:667, via vtnet5

Save configuration:

exit
config save

Final testing

Verifying route between from R7 to R1 using source IP 10.0.7.7/2001:db8:7::7

[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
 1  10.0.5.6 (10.0.5.6)  1.412 ms  1.146 ms  0.304 ms
 2  10.0.4.5 (10.0.4.5)  1.339 ms  1.959 ms  1.241 ms
 3  10.0.3.4 (10.0.3.4)  2.064 ms  1.385 ms  0.735 ms
 4  10.0.2.3 (10.0.2.3)  2.322 ms  1.682 ms  1.004 ms
 5  10.0.1.1 (10.0.1.1)  2.695 ms  2.226 ms  1.135 ms

[root@R7]~# traceroute6 -s 2001:db8:7::7 2001:db8:1::1
traceroute6 to 2001:db8:1::1 (2001:db8:1::1) from 2001:db8:7::7, 64 hops max, 12 byte packets
 1  2001:db8:5::6  1.272 ms  0.481 ms  0.876 ms
 2  2001:db8:4::5  2.568 ms  1.389 ms  2.216 ms
 3  2001:db8:3::4  2.442 ms  2.740 ms  0.958 ms
 4  2001:db8:2::3  1.290 ms  1.055 ms  1.489 ms
 5  2001:db8:1::1  2.038 ms  2.033 ms  1.573 ms
documentation/examples/bgp_route_reflector_and_confederation_using_quagga_and_bird.txt · Last modified: 2014/12/01 17:00 by olivier