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

If you would to use Virtualbox, start this lab withStart the Virtualbox based lab with this command:

virtualbox.sh -i BSDRP_0.35_full_amd64_vga.img -n 7 -l 1 -c

The output should be like that:

BSD Router Project: VirtualBox lab script
Creating lab with 7 router(s):
- 1 LAN between all routers
- Full mesh ethernet point-to-point link between each routers
- One NIC connected to the shared LAN with the host

Router1 have the following NIC:
em0 connected to Router2.
em1 connected to Router3.
em2 connected to Router4.
em3 connected to Router5.
em4 connected to Router6.
em5 connected to Router7.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Router2 have the following NIC:
em0 connected to Router1.
em1 connected to Router3.
em2 connected to Router4.
em3 connected to Router5.
em4 connected to Router6.
em5 connected to Router7.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Router3 have the following NIC:
em0 connected to Router1.
em1 connected to Router2.
em2 connected to Router4.
em3 connected to Router5.
em4 connected to Router6.
em5 connected to Router7.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Router4 have the following NIC:
em0 connected to Router1.
em1 connected to Router2.
em2 connected to Router3.
em3 connected to Router5.
em4 connected to Router6.
em5 connected to Router7.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Router5 have the following NIC:
em0 connected to Router1.
em1 connected to Router2.
em2 connected to Router3.
em3 connected to Router4.
em4 connected to Router6.
em5 connected to Router7.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Router6 have the following NIC:
em0 connected to Router1.
em1 connected to Router2.
em2 connected to Router3.
em3 connected to Router4.
em4 connected to Router5.
em5 connected to Router7.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Router7 have the following NIC:
em0 connected to Router1.
em1 connected to Router2.
em2 connected to Router3.
em3 connected to Router4.
em4 connected to Router5.
em5 connected to Router6.
em6 connected to LAN number 1.
em7 connected to shared-with-host LAN.
Connect to the router 1 by vnc client on port 5901
Connect to the router 2 by vnc client on port 5902
Connect to the router 3 by vnc client on port 5903
Connect to the router 4 by vnc client on port 5904
Connect to the router 5 by vnc client on port 5905
Connect to the router 6 by vnc client on port 5906
Connect to the router 7 by vnc client on port 5907
You need to configure an IP address in these range for communicating with the host:
        inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255
        inet6 fe80::800:27ff:fe00:0%vboxnet0 prefixlen 64 scopeid 0x5

Routers configuration

Router 1

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

sysrc hostname=R1
sysrc ifconfig_em6="10.0.6.1/24"
sysrc ipv6_ifconfig_em6="2001:db8:6::1 prefixlen 64"
sysrc ifconfig_em0="10.0.1.1/24"
sysrc ipv6_ifconfig_em0="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 /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.101;

# Sync bird routing table with kernel
protocol kernel {
        import all;
        export all;
}

# Include device route (warning, a device route is a /32)
protocol device {
        scan time 10;
}

# Include directly connected network
# with the exepction of em7
protocol direct {
        interface "-em7","*";
}

# Set-up a filter called "bgp_out" that will restrict 
# route 10.0.1.0/24 to be advertissed 
# without, all /32 device route will be advertissed too
filter bgp_out {
        if (net = 10.0.1.0/24 ) &&
        (source = RTS_DEVICE) then accept;
        else reject;
}

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

Now start bird process :

service bird start

Now, IPv6 bird process: Create /usr/local/etc/bird6.conf and put these lines in:

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 {
        import all;
        export all;
}

protocol device {
        scan time 10;
}

# Include directly connected network
# with the exepction of em7
protocol direct {
        interface "-em7","*";
}

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_em6="10.0.6.2/24"
sysrc ipv6_ifconfig_em6="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;

# Sync bird routing table with kernel
protocol kernel {
        import all;
        export all;
}

protocol device {
        scan time 10;
}

# Include directly connected network
protocol direct {
        interface "-em7","*";
}

protocol bgp R1 {
        local as 100;
        neighbor 10.0.6.1 as 100;
        import all;
        export all;
        rr client;
}

protocol bgp R3 {
        local as 100;
        neighbor 10.0.6.3 as 100;
        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
BIRD 1.3.3 ready.
bird> show protocols all R1
name     proto    table    state  since       info
R1       BGP      master   up     12:23       Established
  Preference:     100
  Input filter:   ACCEPT
  Output filter:  ACCEPT
  Routes:         1 imported, 2 exported, 1 preferred
  Route change stats:     received   rejected   filtered    ignored   accepted
    Import updates:              1          0          0          0          1
    Import withdraws:            0          0        ---          0          0
    Export updates:              3          1          0        ---          2
    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 AS4
    Session:          internal route-reflector AS4
    Source address:   10.0.6.2
    Hold timer:       224/240
    Keepalive timer:  65/80

bird> show route 10.0.1.0/24
10.0.1.0/24        via 10.0.6.1 on em6 [R1 12:23] * (100/0) [i]

bird> exit

Now, IPv6 bird process: Create /usr/local/etc/bird6.conf and put these lines in:

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;

# Sync bird routing table with kernel
protocol kernel {
        import all;
        export all;
}

protocol device {
        scan time 10;
}

# Include directly connected network
protocol direct {
        interface "-em7","*";
}

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

protocol bgp R3 {
        local as 100;
        neighbor 2001:db8:6::3 as 100;
        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]~# birdc6
BIRD 1.3.3 ready.
bird> show protocols all R1
name     proto    table    state  since       info
R1       BGP      master   up     12:27       Established
  Preference:     100
  Input filter:   ACCEPT
  Output filter:  ACCEPT
  Routes:         1 imported, 1 exported, 1 preferred
  Route change stats:     received   rejected   filtered    ignored   accepted
    Import updates:              1          0          0          0          1
    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 AS4
    Session:          internal route-reflector AS4
    Source address:   2001:db8:6::2
    Hold timer:       147/240
    Keepalive timer:  17/80

bird> show route 2001:db8:1::/64
2001:db8:1::/64    via fe80::cecc:ff:fe00:101 on em6 [R1 12:27 from 2001:db8:6::1] * (100/0) [i]

Save configuration:

config save

Router 3

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

hostname="R3.bsdrp.net"
ifconfig_em6="10.0.6.3/24"
ipv6_ifconfig_em6="2001:db8:6::3 prefixlen 64"
ifconfig_em2="10.0.2.3/24"
ipv6_ifconfig_em2="2001:db8:2::3 prefixlen 64"
quagga_enable="NO"
bird_enable="YES"
bird6_enable="YES"
# BGP TCP MD5 checksum is not managed by bird
ipsec_enable="YES"
ipsec_file="/etc/ipsec.conf"

And edit /etc/ipsec.conf:

flush ;
add 10.0.2.3 10.0.2.4 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:2::3 2001:db8:2::4 tcp 0x1000 -A tcp-md5 "abigpassword" ;

Then apply changes:

hostname R3.bsdrp.net
/usr/local/etc/rc.d/quagga stop
/etc/rc.d/netif restart
/etc/rc.d/network_ipv6 restart
setkey -f /etc/ipsec.conf

Create /usr/local/etc/bird.conf and put theses lines in:

# Configure logging
log syslog all;
log "/var/log/bird.log" all;
log stderr all;

# Override router ID
router id 0.0.0.103;

# Sync bird routing table with kernel
protocol kernel {
        import all;
        export all;
}

protocol device {
        scan time 10;
}

# Include directly connected network
# with the exepction of em7
protocol direct {
        interface "-em7","*";
}

protocol bgp R2 {
        local as 100;
        neighbor 10.0.6.2 as 100;
        import all;
        export all;
        next hop self;
}

protocol bgp R4 {
        local as 100;
        neighbor 10.0.2.4 as 200;
        import all;
        export all;
        next hop self;
}

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

[root@R3]~#/usr/local/etc/rc.d/bird start
Starting bird.
bird> show protocols all R2
name     proto    table    state  since       info
R2       BGP      master   up     12:30       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 AS4
    Session:          internal AS4
    Source address:   10.0.6.3
    Hold timer:       176/240
    Keepalive timer:  68/80

bird> show route 10.0.1.0/24
10.0.1.0/24        via 10.0.6.1 on em6 [R2 12:30 from 10.0.6.2] * (100/0) [i]

Now, IPv6 bird process,

edit /usr/local/etc/bird6.conf and put theses lines in:

# Configure logging
log syslog all;
log "/var/log/bird6.log" all;
log stderr all;

# Override router ID
router id 0.0.0.103;

# Sync bird routing table with kernel
protocol kernel {
        import all;
        export all;
}

protocol device {
        scan time 10;
}

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

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

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

[root@R3]~#/usr/local/etc/rc.d/bird6 start
Starting bird.
[root@R3]~# birdc6
BIRD 1.3.3 ready.
bird> show protocols all R2
name     proto    table    state  since       info
R2       BGP      master   up     12:33       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: 2001:db8:6::2
    Neighbor AS:      100
    Neighbor ID:      0.0.0.102
    Neighbor caps:    refresh AS4
    Session:          internal AS4
    Source address:   2001:db8:6::3
    Hold timer:       231/240
    Keepalive timer:  33/80

bird> show route 2001:db8:1::/64
2001:db8:1::/64    via fe80::cecc:ff:fe00:101 on em6 [R2 12:33 from 2001:db8:6::2] * (100/0) [i]

Save configuration:

config save

Router 4

Configure router hostname:

echo 'hostname="R4.bsdrp.net"' >> /etc/rc.conf
hostname R4.bsdrp.net

Enter in Quagga configuration (vtysh):

cli

And configure IP addresses on public interfaces:

R4.bsdrp.net# conf t
R4.bsdrp.net(config)# interface em2
R4.bsdrp.net(config-if)# ip address 10.0.2.4/24
R4.bsdrp.net(config-if)# ipv6 address 2001:db8:2::4/64
R4.bsdrp.net(config-if)# interface em3
R4.bsdrp.net(config-if)# ip address 10.0.3.4/24
R4.bsdrp.net(config-if)# ipv6 address 2001:db8:3::4/64
R4.bsdrp.net(config-if)# exit
R4.bsdrp.net(config)# 

Then configure BGP:

R4.bsdrp.net(config)# router bgp 64512
R4.bsdrp.net(config-router)# bgp router-id 204
R4.bsdrp.net(config-router)# bgp confederation identifier 200
R4.bsdrp.net(config-router)# bgp confederation peers 65535
R4.bsdrp.net(config-router)# network 10.0.3.0/24
R4.bsdrp.net(config-router)# neighbor 10.0.2.3 remote-as 100
R4.bsdrp.net(config-router)# neighbor 10.0.2.3 password abigpassword
R4.bsdrp.net(config-router)# neighbor 10.0.3.5 remote-as 64512
R4.bsdrp.net(config-router)# neighbor 10.0.3.5 next-hop-self 
R4.bsdrp.net(config-router)# no synchronization 
R4.bsdrp.net(config-router)# neighbor 2001:db8:3::5 remote-as 64512
R4.bsdrp.net(config-router)# neighbor 2001:db8:3::5 next-hop-self
R4.bsdrp.net(config-router)# no neighbor 2001:db8:3::5 activate
R4.bsdrp.net(config-router)# neighbor 2001:db8:2::3 remote-as 100
R4.bsdrp.net(config-router)# no neighbor 2001:db8:2::3 activate
R4.bsdrp.net(config-router)# neighbor 2001:db8:2::3 password abigpassword
R4.bsdrp.net(config-router)# address-family ipv6
R4.bsdrp.net(config-router-af)# network 2001:db8:3::/64
R4.bsdrp.net(config-router-af)# neighbor 2001:db8:3::5 activate
R4.bsdrp.net(config-router-af)# neighbor 2001:db8:2::3 activate
R4.bsdrp.net(config-router-af)# exit
R4.bsdrp.net(config-router)# exit 
R4.bsdrp.net(config)# exit

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

R4.bsdrp.net# sh ip bgp summary
BGP router identifier 0.0.0.204, local AS number 64512
RIB entries 7, using 672 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      23      22        0    0    0 00:18:53        3
10.0.3.5        4 64512       0       0        0    0    0 never    Active

Total number of neighbors 2

R4.bsdrp.net# show ipv6 bgp summary
BGP router identifier 0.0.0.204, local AS number 64512
RIB entries 7, using 672 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       6      11        0    0    0 00:03:19        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.bsdrp.net# 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:19:45 ago
  * 10.0.2.3, via em2

R4.bsdrp.net# 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:04:09 ago
  * fe80::a8aa:ff:fe00:334, via em2

Then write quagga config file and exit the quagga cli:

R4.bsdrp.net(config)# exit
R4.bsdrp.net# wr
Building Configuration...
Configuration saved to /usr/local/etc/quagga/zebra.conf
Configuration saved to /usr/local/etc/quagga/ripd.conf
Configuration saved to /usr/local/etc/quagga/ripngd.conf
Configuration saved to /usr/local/etc/quagga/ospfd.conf
Configuration saved to /usr/local/etc/quagga/ospf6d.conf
Configuration saved to /usr/local/etc/quagga/bgpd.conf
Configuration saved to /usr/local/etc/quagga/isisd.conf
[OK]
R4.bsdrp.net# exit

Save configuration:

config save

Router 5

Configure router hostname:

echo 'hostname="R5.bsdrp.net"' >> /etc/rc.conf
hostname R5.bsdrp.net

Enter in Quagga configuration (vtysh):

cli

And configure IP addresses on public interfaces:

R5.bsdrp.net# conf t
R5.bsdrp.net(config)# interface em3            
R5.bsdrp.net(config-if)# ip address 10.0.3.5/24
R5.bsdrp.net(config-if)# ipv6 address 2001:db8:3::5/64
R5.bsdrp.net(config-if)# interface em4
R5.bsdrp.net(config-if)# ip address 10.0.4.5/24
R5.bsdrp.net(config-if)# ipv6 address 2001:db8:4::5/64
R5.bsdrp.net(config-if)# exit

Then configure BGP:

R5.bsdrp.net(config)# router bgp 64512
R5.bsdrp.net(config-router)# bgp router-id 205
R5.bsdrp.net(config-router)# bgp confederation identifier 200      
R5.bsdrp.net(config-router)# bgp confederation peers 65535
R5.bsdrp.net(config-router)# no synchronization
R5.bsdrp.net(config-router)# network 10.0.3.0/24
R5.bsdrp.net(config-router)# neighbor 10.0.3.4 remote-as 64512
R5.bsdrp.net(config-router)# neighbor 10.0.3.4 next-hop-self
R5.bsdrp.net(config-router)# neighbor 10.0.4.6 remote-as 65535
R5.bsdrp.net(config-router)# neighbor 10.0.4.6 next-hop-self
R5.bsdrp.net(config-router)# neighbor 2001:db8:3::4 remote-as 64512 
R5.bsdrp.net(config-router)# no neighbor 2001:db8:3::4 activate  
R5.bsdrp.net(config-router)# neighbor 2001:db8:4::6 remote-as 65535
R5.bsdrp.net(config-router)# no neighbor 2001:db8:4::6 activate 
R5.bsdrp.net(config-router)# address-family ipv6 
R5.bsdrp.net(config-router-af)# network 2001:db8:3::/64              
R5.bsdrp.net(config-router-af)# neighbor 2001:db8:3::4 activate
R5.bsdrp.net(config-router-af)# neighbor 2001:db8:3::4 next-hop-self
R5.bsdrp.net(config-router-af)# neighbor 2001:db8:4::6 activate
R5.bsdrp.net(config-router-af)# neighbor 2001:db8:4::6 next-hop-self 
R5.bsdrp.net(config-router-af)# exit
R5.bsdrp.net(config-router)# exit
R5.bsdrp.net(config)# exit

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

R5.bsdrp.net# sh ip bgp summary
BGP router identifier 0.0.0.205, local AS number 64512
RIB entries 7, using 672 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       5       5        0    0    0 00:01:25        4
10.0.4.6        4 65535       0       0        0    0    0 never    Connect

Total number of neighbors 2
R5.bsdrp.net# sh ipv6 bgp summary
BGP router identifier 0.0.0.205, local AS number 64512
RIB entries 7, using 672 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       6        0    0    0 00:00:03        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.bsdrp.net# 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:02:29 ago
  * 10.0.3.4, via em3

R5.bsdrp.net# 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:01:17 ago
  * fe80::a8aa:ff:fe00:445, via em3

Then write quagga config file and exit the quagga cli:

R5.bsdrp.net(config)# exit
R5.bsdrp.net# wr
Building Configuration...
Configuration saved to /usr/local/etc/quagga/zebra.conf
Configuration saved to /usr/local/etc/quagga/ripd.conf
Configuration saved to /usr/local/etc/quagga/ripngd.conf
Configuration saved to /usr/local/etc/quagga/ospfd.conf
Configuration saved to /usr/local/etc/quagga/ospf6d.conf
Configuration saved to /usr/local/etc/quagga/bgpd.conf
Configuration saved to /usr/local/etc/quagga/isisd.conf
[OK]
R5.bsdrp.net# exit

Save configuration:

config save

Router 6

Configure router hostname:

echo 'hostname="R6.bsdrp.net"' >> /etc/rc.conf
hostname R6.bsdrp.net

Enter in Quagga configuration (vtysh):

cli

And configure IP addresses on public interfaces:

R6.bsdrp.net# conf t
R6.bsdrp.net(config)# interface em4
R6.bsdrp.net(config-if)# ip address 10.0.4.6/24
R6.bsdrp.net(config-if)# ipv6 address 2001:db8:4::6/64
R6.bsdrp.net(config-if)# interface em5
R6.bsdrp.net(config-if)# ip address 10.0.5.6/24
R6.bsdrp.net(config-if)# ipv6 address 2001:db8:5::6/64
R6.bsdrp.net(config-if)# exit

Then configure BGP:

R6.bsdrp.net(config)# router bgp 65535
R6.bsdrp.net(config-router)# bgp router-id 206
R6.bsdrp.net(config-router)# bgp confederation identifier 200
R6.bsdrp.net(config-router)# bgp confederation peers 64512   
R6.bsdrp.net(config-router)# no synchronization           
R6.bsdrp.net(config-router)# network 10.0.5.0/24
R6.bsdrp.net(config-router)# neighbor 10.0.4.5 remote-as 64512
R6.bsdrp.net(config-router)# neighbor 10.0.4.5 next-hop-self 
R6.bsdrp.net(config-router)# neighbor 10.0.5.7 remote-as 65535
R6.bsdrp.net(config-router)# neighbor 10.0.5.7 next-hop-self
R6.bsdrp.net(config-router)# neighbor 10.0.5.7 password abcdefgh
R6.bsdrp.net(config-router)# neighbor 2001:db8:5::7 remote-as 65535
R6.bsdrp.net(config-router)# no neighbor 2001:db8:5::7 activate
R6.bsdrp.net(config-router)# neighbor 2001:db8:5::7 password abcdefgh
R6.bsdrp.net(config-router)# neighbor 2001:db8:4::5 remote-as 64512    
R6.bsdrp.net(config-router)# no neighbor 2001:db8:4::5 activate
R6.bsdrp.net(config-router)# address-family ipv6
R6.bsdrp.net(config-router-af)# network 2001:db8:5::/64
R6.bsdrp.net(config-router-af)# neighbor 2001:db8:4::5 activate
R6.bsdrp.net(config-router-af)# neighbor 2001:db8:4::5 next-hop-self
R6.bsdrp.net(config-router-af)# neighbor 2001:db8:5::7 activate
R6.bsdrp.net(config-router-af)# neighbor 2001:db8:5::7 next-hop-self
R6.bsdrp.net(config-router-af)# exit
R6.bsdrp.net(config-router)# exit
R6.bsdrp.net(config)# exit

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

R6.bsdrp.net# sh ip bgp summary
BGP router identifier 0.0.0.206, local AS number 65535
RIB entries 9, using 864 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       5       6        0    0    0 00:01:29        4
10.0.5.7        4 65535       0       0        0    0    0 never    Connect

Total number of neighbors 2
R6.bsdrp.net# sh ipv6 bgp summary
BGP router identifier 0.0.0.206, local AS number 65535
RIB entries 9, using 864 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       7       5        0    0    0 00:00:25        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.bsdrp.net# 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:02:09 ago
  * 10.0.4.5, via em4

R6.bsdrp.net# 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:08 ago
  * fe80::a8aa:ff:fe00:556, via em4

Then write quagga config file and exit the quagga cli:

R6.bsdrp.net(config)# exit
R6.bsdrp.net# wr
Building Configuration...
Configuration saved to /usr/local/etc/quagga/zebra.conf
Configuration saved to /usr/local/etc/quagga/ripd.conf
Configuration saved to /usr/local/etc/quagga/ripngd.conf
Configuration saved to /usr/local/etc/quagga/ospfd.conf
Configuration saved to /usr/local/etc/quagga/ospf6d.conf
Configuration saved to /usr/local/etc/quagga/bgpd.conf
Configuration saved to /usr/local/etc/quagga/isisd.conf
[OK]
R6.bsdrp.net# exit

Save configuration:

config save

Router 7

Configure router hostname:

echo 'hostname="R7.bsdrp.net"' >> /etc/rc.conf
hostname R7.bsdrp.net

Enter in Quagga configuration (vtysh):

cli

And configure IP addresses on public interfaces:

R7.bsdrp.net# conf t
R7.bsdrp.net(config)# interface em5
R7.bsdrp.net(config-if)# ip address 10.0.5.7/24
R7.bsdrp.net(config-if)# ipv6 address 2001:db8:5::7/64
R7.bsdrp.net(config-if)# interface em0
R7.bsdrp.net(config-if)# ip address 10.0.7.7/24
R7.bsdrp.net(config-if)# ipv6 address 2001:db8:7::7/64
R7.bsdrp.net(config-if)# exit

Then configure BGP:

R7.bsdrp.net(config)# router bgp 65535
R7.bsdrp.net(config-router)# bgp router-id 207
R7.bsdrp.net(config-router)# bgp confederation identifier 200
R7.bsdrp.net(config-router)# bgp confederation peers 64512
R7.bsdrp.net(config-router)# no synchronization 
R7.bsdrp.net(config-router)# network 10.0.5.0/24
R7.bsdrp.net(config-router)# network 10.0.7.0/24
R7.bsdrp.net(config-router)# neighbor 10.0.5.6 remote-as 65535
R7.bsdrp.net(config-router)# neighbor 10.0.5.6 password abcdefgh
R7.bsdrp.net(config-router)# neighbor 2001:db8:5::6 remote-as 65535
R7.bsdrp.net(config-router)# no neighbor 2001:db8:5::6 activate 
R7.bsdrp.net(config-router)# neighbor 2001:db8:5::6 password abcdefgh
R7.bsdrp.net(config-router)# address-family ipv6
R7.bsdrp.net(config-router-af)# network 2001:db8:7::/64
R7.bsdrp.net(config-router-af)# network 2001:db8:5::/64
R7.bsdrp.net(config-router-af)# neighbor 2001:db8:5::6 activate
R7.bsdrp.net(config-router-af)# exit     
R7.bsdrp.net(config-router)# exit
R7.bsdrp.net(config)# exit

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

R7.bsdrp.net# 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.bsdrp.net# 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 R6 learn the IPv4/IPv6 routes advertised by R6:

R7.bsdrp.net# 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 em5

R7.bsdrp.net# 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 em5

Then write quagga config file and exit the quagga cli:

R7.bsdrp.net(config)# exit
R7.bsdrp.net# wr
Building Configuration...
Configuration saved to /usr/local/etc/quagga/zebra.conf
Configuration saved to /usr/local/etc/quagga/ripd.conf
Configuration saved to /usr/local/etc/quagga/ripngd.conf
Configuration saved to /usr/local/etc/quagga/ospfd.conf
Configuration saved to /usr/local/etc/quagga/ospf6d.conf
Configuration saved to /usr/local/etc/quagga/bgpd.conf
Configuration saved to /usr/local/etc/quagga/isisd.conf
[OK]
R7.bsdrp.net# exit

Save configuration:

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: 2013/10/27 07:41 by olivier