User Tools

Site Tools


documentation:examples:simple_bgp-rip-ospf_lab

BGP/OSPF/RIP/ISIS/BABEL lab with FRRouting

This Labs is done with BSDRP under qemu and it explains how to use BSDRP using FRRouting (Quagga fork).

Presentation

Network diagram

Here is the logical and physical view:

Setting-up the lab

Downloading BSD Router Project images

Download BSDRP serial image (prevent to have to use an X display) on Sourceforge.

Download Lab scripts

More information on these BSDRP lab scripts available on How to build a BSDRP router lab.

Start the lab with 5 routers, here is an example with VirtualBox:

./BSDRP-lab-vbox.sh -i BSDRP-1.91-full-amd64-serial.img.xz -n 7

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 frr_vm[VM-NUMBER]

Router 1

sysrc hostname=router1
sysrc cloned_interfaces=lo1
sysrc ipsec_enable=YES
sysrc ipsec_file="/etc/ipsec.conf"
sysrc frr_enable=yes
cat <<EOF > /etc/ipsec.conf
flush ;
add 192.168.12.1 192.168.12.2 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add 192.168.12.2 192.168.12.1 tcp 0x1001 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:12::1 2001:db8:12::2 tcp 0x1002 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:12::2 2001:db8:12::1 tcp 0x1003 -A tcp-md5 "abigpassword" ;
EOF

cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em0
 ip address 192.168.12.1/24
 ipv6 address 2001:db8:12::1/64
interface vtnet0
 ip address 192.168.12.1/24
 ipv6 address 2001:db8:12::1/64
interface lo1
 ip address 192.168.10.1/24
 ipv6 address 2001:db8:10::1/64
EOF

cat > /usr/local/etc/frr/bgpd.conf <<EOF
router bgp 12
 bgp router-id 192.168.10.1
 neighbor 192.168.12.2 remote-as 12
 neighbor 192.168.12.2 bfd
 neighbor 192.168.12.2 password abigpassword
 neighbor 2001:db8:12::2 remote-as 12
 neighbor 2001:db8:12::2 bfd
 neighbor 2001:db8:12::2 password abigpassword
 !
 address-family ipv4 unicast
  network 192.168.10.0/24
  neighbor 192.168.12.2 soft-reconfiguration inbound
  no neighbor 2001:db8:12::2 activate
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8:10::/64
  neighbor 2001:db8:12::2 activate
  neighbor 2001:db8:12::2 soft-reconfiguration inbound
 exit-address-family
EOF

cat > /usr/local/etc/frr/bfdd.conf <<EOF
bfd
 peer 2001:db8:12::2 local-address 2001:db8:12::1
  label router2-6
  no shutdown
 peer 192.168.12.2
  label router2-4
  no shutdown
EOF

hostname router1
service netif restart
service ipsec start
service frr start
config save

Router 2

sysrc hostname=router2
sysrc ipsec_enable=YES
sysrc ipsec_file="/etc/ipsec.conf"
sysrc frr_enable=YES
cat <<EOF > /etc/ipsec.conf
flush ;
add 192.168.12.1 192.168.12.2 tcp 0x1000 -A tcp-md5 "abigpassword" ;
add 192.168.12.2 192.168.12.1 tcp 0x1001 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:12::1 2001:db8:12::2 tcp 0x1002 -A tcp-md5 "abigpassword" ;
add -6 2001:db8:12::2 2001:db8:12::1 tcp 0x1003 -A tcp-md5 "abigpassword" ;
EOF
cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em0
 ip address 192.168.12.2/24
 ipv6 address 2001:db8:12::2/64
interface vtnet0
 ip address 192.168.12.2/24
 ipv6 address 2001:db8:12::2/64
interface em1
 ip address 192.168.23.2/24
 ipv6 address 2001:db8:23::2/64
interface vtnet1
 ip address 192.168.23.2/24
 ipv6 address 2001:db8:23::2/64
EOF
cat > /usr/local/etc/frr/ripd.conf <<EOF
key chain rippass
 key 1
  key-string rippassword
!
interface em1
 ip rip authentication key-chain rippass
 ip rip authentication mode md5
!
interface vtnet1
 ip rip authentication key-chain rippass
 ip rip authentication mode md5
!
router rip
 version 2
 network em1
 network vtnet1
 redistribute bgp
 redistribute connected
EOF
cat > /usr/local/etc/frr/ripngd.conf <<EOF
router ripng
 network em1
 network vtnet1
 redistribute bgp
 redistribute connected
EOF
cat > /usr/local/etc/frr/bgpd.conf <<EOF
router bgp 12
 bgp router-id 192.168.10.2
 neighbor 192.168.12.1 remote-as 12
 neighbor 192.168.12.1 bfd
 neighbor 192.168.12.1 password abigpassword
 neighbor 2001:db8:12::1 remote-as 12
 neighbor 2001:db8:12::1 bfd
 neighbor 2001:db8:12::1 password abigpassword
 !
 address-family ipv4 unicast
  network 192.168.12.0/24
  redistribute rip
  neighbor 192.168.12.1 soft-reconfiguration inbound
  neighbor 192.168.12.1 next-hop-self
  no neighbor 2001:db8:12::1 activate
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8:12::/64
  redistribute ripng
  neighbor 2001:db8:12::1 activate
  neighbor 2001:db8:12::1 soft-reconfiguration inbound
 exit-address-family
EOF

cat > /usr/local/etc/frr/bfdd.conf <<EOF
bfd
 peer 2001:db8:12::1 local-address 2001:db8:12::2
  label router1-6
  no shutdown
 peer 192.168.12.1
  label router1-4
  no shutdown
EOF

hostname router2
service ipsec start
service frr start
config save

Router 3

sysrc hostname=router3
sysrc frr_enable=YES
cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em1
 ip address 192.168.23.3/24
 ipv6 address 2001:db8:23::3/64
interface vtnet1
 ip address 192.168.23.3/24
 ipv6 address 2001:db8:23::3/64
interface em2
 ip address 192.168.34.3/24
 ipv6 address 2001:db8:34::3/64
interface vtnet2
 ip address 192.168.34.3/24
 ipv6 address 2001:db8:34::3/64
EOF
cat > /usr/local/etc/frr/ospfd.conf <<EOF
interface em2
 ip ospf message-digest-key 1 md5 superpass
 ip ospf bfd
interface vtnet2
 ip ospf message-digest-key 1 md5 superpass
 ip ospf bfd
router ospf
 ospf router-id 3.3.3.3
 redistribute rip
 redistribute connected
 network 192.168.34.0/24 area 0.0.0.0
 area 0.0.0.0 authentication message-digest
EOF
cat > /usr/local/etc/frr/ospf6d.conf <<EOF
interface em2
 ipv6 ospf6 bfd
interface vtnet2
 ipv6 ospf6 bfd
router ospf6
 router-id 2.2.2.2
 redistribute ripng
 redistribute connected
 interface em2 area 0.0.0.0
 interface vtnet2 area 0.0.0.0
EOF
cat > /usr/local/etc/frr/ripd.conf <<EOF
key chain rippass
 key 1
  key-string rippassword
!
interface em1
 ip rip authentication key-chain rippass
 ip rip authentication mode md5
!
interface vtnet1
 ip rip authentication key-chain rippass
 ip rip authentication mode md5
!
router rip
 version 2
 network em1
 network vtnet1
 redistribute connected
 redistribute ospf
EOF
cat > /usr/local/etc/frr/ripngd.conf <<EOF
router ripng
 network em1
 network vtnet1
 redistribute connected
 redistribute ospf6
EOF
cat > /usr/local/etc/frr/bfdd.conf <<EOF
bfd
 peer 2001:db8:34::4 local-address 2001:db8:34::3
  label router2-6
  no shutdown
 peer 192.168.34.4
  label router4-4
  no shutdown
EOF
hostname router3
service frr start

Router 4

sysrc hostname=router4
sysrc frr_enable=YES
cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em2
 ip address 192.168.34.4/24
 ipv6 address 2001:db8:34::4/64
interface vtnet2
 ip address 192.168.34.4/24
 ipv6 address 2001:db8:34::4/64
interface em3
 ip address 192.168.45.4/24
 ipv6 address 2001:db8:45::4/64
interface vtnet3
 ip address 192.168.45.4/24
 ipv6 address 2001:db8:45::4/64
EOF
cat > /usr/local/etc/frr/ospfd.conf <<EOF
interface em2
 ip ospf message-digest-key 1 md5 superpass
 ip ospf bfd
interface vtnet2
 ip ospf message-digest-key 1 md5 superpass
 ip ospf bfd
router ospf
 ospf router-id 4.4.4.4
 redistribute isis
 redistribute connected
 network 192.168.34.0/24 area 0.0.0.0
 area 0.0.0.0 authentication message-digest
EOF
cat > /usr/local/etc/frr/ospf6d.conf <<EOF
interface em2
 ipv6 ospf6 bfd
interface vtnet2
 ipv6 ospf6 bfd
router ospf6
 router-id 4.4.4.4
 redistribute isis
 redistribute connected
 interface em2 area 0.0.0.0
 interface vtnet2 area 0.0.0.0
EOF
cat > /etc/local/frr/isisd.conf <<EOF
interface em3
 ip router isis BSDRP
 ipv6 router isis BSDRP
 isis circuit-type level-2-only
interface vtnet3
 ip router isis BSDRP
 ipv6 router isis BSDRP
 isis circuit-type level-2-only
router isis BSDRP
 net 49.0000.0000.0004.00
 metric-style wide
 redistribute ipv4 ospf level-2
 redistribute ipv6 ospf6 level-2
 redistribute ipv4 connected level-2
 redistribute ipv6 connected level-2
EOF
cat > /usr/local/etc/frr/bfdd.conf <<EOF
bfd
 peer 2001:db8:34::3 local-address 2001:db8:34::4
  label router3-6
  no shutdown
 peer 192.168.34.3
  label router3-4
  no shutdown
EOF
hostname router4
service frr start

Router 5

sysrc hostname=router5
sysrc frr_enable=YES
cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em3
 ip address 192.168.45.5/24
 ipv6 address 2001:db8:45::5/64
interface vtnet3
 ip address 192.168.45.5/24
 ipv6 address 2001:db8:45::5/64
interface em4
 ip address 192.168.56.5/24
 ipv6 address 2001:db8:56::5/64
interface vtnet4
 ip address 192.168.56.5/24
 ipv6 address 2001:db8:56::5/64
EOF
cat > /etc/local/frr/isisd.conf <<EOF
interface em3
 ip router isis BSDRP
 ipv6 router isis BSDRP
 isis circuit-type level-2-only
interface vtnet3
 ip router isis BSDRP
 ipv6 router isis BSDRP
 isis circuit-type level-2-only
interface em4
 ip router isis BSDRP
 isis passive
 ipv6 router isis BSDRP
 isis circuit-type level-2-only
interface vtnet4
 ip router isis BSDRP
 isis passive
 ipv6 router isis BSDRP
 isis circuit-type level-2-only
router isis BSDRP
 net 49.0000.0000.0005.00
 metric-style wide
 redistribute ipv4 babel level-2
 redistribute ipv6 babel level-2
EOF
cat > /usr/local/etc/frr/babeld.conf <<EOF
router babel
 network em3
 network vtnet3
 network em4
 network vtnet4
 redistribute ipv4 isis
 redistribute ipv6 isis
EOF
hostname router5
service netif restart
service frr start

Router 6

sysrc hostname=router6
sysrc frr_enable=YES
cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em4
 ip address 192.168.56.6/24
 ipv6 address 2001:db8:56::6/64
interface vtnet4
 ip address 192.168.56.6/24
 ipv6 address 2001:db8:56::6/64
interface em5
 ip address 192.168.67.6/24
 ipv6 address 2001:db8:67::6/64
interface vtnet5
 ip address 192.168.67.6/24
 ipv6 address 2001:db8:67::6/64
EOF
cat > /usr/local/etc/frr/babeld.conf <<EOF
router babel
 network em4
 network vtnet4
 redistribute ipv4 connected
 redistribute ipv4 static
 redistribute ipv6 connected
 redistribute ipv6 static
EOF
cat > /usr/local/etc/frr/staticd.conf <<EOF
ip route 192.168.70.0/24 192.168.67.7
ipv6 route 2001:db8:70::/64 2001:db8:67::7
EOF
hostname router6
service netif restart
service frr start

Router 7

sysrc hostname=router7
sysrc cloned_interfaces=lo1
sysrc frr_enable=YES
cat > /usr/local/etc/frr/zebra.conf <<EOF
log syslog
interface em5
 ip address 192.168.67.7/24
 ipv6 address 2001:db8:57::7/64
interface vtnet5
 ip address 192.168.67.7/24
 ipv6 address 2001:db8:67::7/64
interface lo1
 ip address 192.168.70.7/24
 ipv6 address 2001:db8:70::7/64
EOF
cat > /usr/local/etc/frr/staticd.conf <<EOF
ip route 0.0.0.0/0 192.168.67.6
ipv6 route ::/0 2001:db8:67::6
EOF
hostname router7
service netif restart
service frr start

Final testing

Ping router7 loopback from router1 loopback:

[root@router1]~# ping -c 4 -S 192.168.10.1 192.168.70.7
PING 192.168.70.7 (192.168.70.7) from 192.168.10.1: 56 data bytes
64 bytes from 192.168.70.7: icmp_seq=0 ttl=59 time=0.580 ms
64 bytes from 192.168.70.7: icmp_seq=1 ttl=59 time=0.559 ms
64 bytes from 192.168.70.7: icmp_seq=2 ttl=59 time=0.542 ms
64 bytes from 192.168.70.7: icmp_seq=3 ttl=59 time=0.541 ms

--- 192.168.70.7 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.541/0.555/0.580/0.016 ms

[root@router1]~# ping6 -c 4 -S 2001:db8:10::1 2001:db8:70::7
PING6(56=40+8+8 bytes) 2001:db8:10::1 --> 2001:db8:70::7
16 bytes from 2001:db8:70::7, icmp_seq=0 hlim=59 time=0.607 ms
16 bytes from 2001:db8:70::7, icmp_seq=1 hlim=59 time=0.570 ms
16 bytes from 2001:db8:70::7, icmp_seq=2 hlim=59 time=0.526 ms
16 bytes from 2001:db8:70::7, icmp_seq=3 hlim=59 time=0.555 ms

--- 2001:db8:70::7 ping6 statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.526/0.565/0.607/0.029 ms

Don't forget to “force” the source IP address to use the loopback, otherwise router1 will use the output NIC IP address as source.

documentation/examples/simple_bgp-rip-ospf_lab.txt · Last modified: 2018/10/22 08:48 by olivier