Lab 10-4: BGP with GateD

Now we replace the Zebra daemons on callisto and castor with GateD (see Examples 10-19 and 10-20). The secondary interface connecting callisto and ganymed is disabled, and OSPF authentication is turned off to accommodate GateD restrictions.

Although GateD lacks some of the features of Zebra, the configuration tries to mimic the Zebra configurations (Examples 10-11 to 10-13) as closely as possible. GateD uses different group <type> peeras types to configure peerings (<type>=external, IGP, internal, routing) that can be used to configure IBGP and EBGP scenarios. For a more detailed explanation, refer to the V3.6 documentation.

NOTE

Note that the highlighted export statement in Example 10-19 is used to accomplish IBGP route reflector behavior.


Example 10-19. Castor GateD Route Reflector Setup

[root@castor:~#] cat /etc/gated.cfg

routerid 192.168.2.7;

autonomoussystem 65000;



rip off;



ospf yes{

        backbone{

                networks{

                        192.168.2.0  mask 255.255.255.0;

                        192.168.80.0 mask 255.255.255.0;

                        192.168.99.0  mask 255.255.255.252;

                };

                interface xl0 vlan8 wpachdlc0;

        };

};



bgp yes{

        group type routing peeras 65000 proto ospf

        {

                peer 192.168.1.1;

        };



        group type external peeras 65003

        {

                peer 192.168.7.254;

        };

};



static{

        default gateway 192.168.2.254;

};



#exporting to OSPF

export proto ospfase{

        proto static{all; };

        proto direct{all; };

};



export proto bgp as 65000 {

        proto bgp as 65000 {all;}; # for reflection

        proto ospf{all;};

};



export proto bgp as 65003 {

        proto ospf{all;};

};



GateD-castor> show bgp sum

100 Neighbor        V    AS MsgRcvd MsgSent State

100 192.168.1.1     4 65000       3       4 Established

100 192.168.7.254   4 65003       5       4 Established

100 BGP summary, 2 groups, 2 peers.



GateD-castor> show bgp routes 0/0

100 Proto       Route/Mask NextHop         MED   ASPath

100 BGP              10/24 192.168.7.254   0     (65000) 65003 IGP (Id 5)

100 BGP          10.0.1/24 192.168.7.254   0     (65000) 65003 IGP (Id 5)

100 BGP          172.16/25 192.168.7.254   -1    (65000) 65003 65001 IGP (Id 4)

100 BGP    172.16.0.128/25 192.168.7.254   -1    (65000) 65003 65001 IGP (Id 4)



GateD-castor> show ip walkdown 0/0

100 Ker         0.0.0.0/0  192.168.2.254   IGP (Id 1)

100 BGP              10/24 192.168.7.254   (65000) 65003 IGP (Id 5)

100 BGP          10.0.1/24 192.168.7.254   (65000) 65003 IGP (Id 5)

100 Sta             127/8  127.0.0.1       IGP (Id 1)

100 Dir       127.0.0.1/32 127.0.0.1       IGP (Id 1)

100 BGP          172.16/25 192.168.7.254   (65000) 65003 65001 IGP (Id 4)

100 BGP    172.16.0.128/25 192.168.7.254   (65000) 65003 65001 IGP (Id 4)

100 OSP       192.168.1/24 192.168.2.254   (65000) IGP (Id 2)

100 Ker     192.168.1.1/32 192.168.2.254   IGP (Id 1)

100 Ker     192.168.1.2/32 192.168.2.254   IGP (Id 1)

100 Dir       192.168.2/24 192.168.2.7     IGP (Id 1)

100 Dir       192.168.7/24 192.168.7.7     IGP (Id 1)

100 OSP      192.168.14/24 192.168.2.254   (65000) Incomplete (Id 3)

100 OSP      192.168.44/24 192.168.2.254   (65000) Incomplete (Id 3)

100 Dir      192.168.80/24 192.168.80.1    IGP (Id 1)

100 Dir    192.168.99.1/32 127.0.0.1       IGP (Id 1)

100 Dir    192.168.99.2/32 192.168.99.1    IGP (Id 1)

100 OSP       211.11.117/24 192.168.2.254   (65000) Incomplete (Id 3)



GateD-castor> show bgp peeras 65003

100 group type External AS 65003 local 65000 flags <>

100  peer 192.168.7.254 version 4 lcladdr (null) gateway (null)

100   flags 0x0

100   state 0x6 <Established>

100   options 0x0 <>

100   metric_out -1

100   preference 170

100   preference2 0

100   recv buffer size 0

100   send buffer size 0

100   messages in 24 (updates 3, not updates 21) 559 octets

messages out 23 (updates 1, not updates 22) 473 octets



[root@castor:~#] netstat -rn -f inet

Routing tables



Internet:

Destination        Gateway            Flags    Refs      Use  Netif Expire

default            192.168.2.254      UGSc        1       62    xl0

10/24              192.168.7.254      UGc         0        0    ed0

10.0.1/24          192.168.7.254      UGc         0        0    ed0

127                127.0.0.1          URc         0        0    lo0

127.0.0.1          127.0.0.1          UH          2      186    lo0

172.16/25          192.168.7.254      UGc         0        0    ed0

172.16.0.128/25    192.168.7.254      UGc         0        0    ed0

192.168.1          192.168.2.254      UGc         2        2    xl0

192.168.2          link#1             UC          1        0    xl0

192.168.2.254      52:54:05:e3:e4:2f  UHLW        7        0    xl0    337

192.168.7          link#2             UC          1        0    ed0

192.168.7.254      00:00:0c:1a:a9:a8  UHLW        7       67    ed0    347

192.168.14         192.168.2.254      UGc         0        0    xl0

192.168.44         192.168.2.254      UGc         0        3    xl0

192.168.80         link#15            UC          0        0  vlan8

192.168.99.1       127.0.0.1          UGH         0        0    lo0

192.168.99.2       192.168.99.1       UH          0        3 wpachd

211.11.117         192.168.2.254      UGc         0        0    xl0

224.0.0.5          127.0.0.1          UH          0        0    lo0

224.0.0.6          127.0.0.1          UH          0        0    lo0


Example 10-20. Callisto GateD Setup

[root@callisto:~#] cat /etc/gated.conf

routerid 192.168.1.1;

autonomoussystem 65000;



rip off;



ospf yes{

        backbone{

                networks{

                        192.168.1.0  mask 255.255.255.0;

                        192.168.99.0  mask 255.255.255.252;

                        192.168.45.0 mask 255.255.255.0;

                };

                interface eth1 wp1chdlc;

        };

};



bgp yes{

        group type routing peeras 65000 proto ospf

        {

                peer 192.168.44.1;

                peer 192.168.2.7;

        };

        group type external peeras 65001

        {

                peer 192.168.14.2;

        };

        group type external peeras 65003

        {

                peer 192.168.14.254;

        };

};



static{

        default gateway 192.168.1.254;

};



#exporting to OSPF

export proto ospfase{

        #restrict;

        proto static{all; };

        proto direct{all; };

        #proto kernel{all; };

};



export proto bgp as 65000 {

        proto bgp as 65000 {all;}; # for reflection

        proto ospf{all;};

};



export proto bgp as 65001 {

        proto ospf{all;};

};



export proto bgp as 65003 {

        proto ospf{all;};

};



GateD-callisto> show bgp sum

100 Neighbor        V    AS MsgRcvd MsgSent State

100 192.168.44.1    4 65000      90      96 Established

100 192.168.2.7     4 65000      27      29 Established

100 192.168.14.2    4 65001     103      98 Established

100 192.168.14.254  4 65003     108      98 Established

100 BGP summary, 3 groups, 4 peers.



GateD-callisto> show bgp routes 0/0

100 Proto       Route/Mask NextHop         MED   ASPath

100 BGP              10/24 192.168.14.254  0     (65000) 65003 IGP (Id 7)

100 BGP          10.0.1/24 192.168.14.254  0     (65000) 65003 IGP (Id 7)

100 BGP          172.16/25 192.168.14.2    0     (65000) 65001 IGP (Id 5)

100 BGP    172.16.0.128/25 192.168.14.2    0     (65000) 65001 IGP (Id 5)



GateD-callisto> show ip walkdown 0/0

100 Sta         0.0.0.0/0  192.168.1.254   IGP (Id 1)

100 BGP              10/24 192.168.14.254  (65000) 65003 IGP (Id 7)

100 BGP          10.0.1/24 192.168.14.254  (65000) 65003 IGP (Id 7)

100 Sta             127/8  127.0.0.1       IGP (Id 1)

100 Dir       127.0.0.1/32 127.0.0.1       IGP (Id 1)

100 BGP          172.16/25 192.168.14.2    (65000) 65001 IGP (Id 5)

100 BGP    172.16.0.128/25 192.168.14.2    (65000) 65001 IGP (Id 5)

100 Dir       192.168.1/24 192.168.1.1     IGP (Id 1)

100 OSP       192.168.2/24 192.168.1.254   (65000) IGP (Id 8)

100 OSP       192.168.7/24 192.168.1.254   (65000) IGP (Id 8)

100 Dir      192.168.14/24 192.168.14.1    IGP (Id 1)

100 OSP      192.168.44/24 192.168.1.254   (65000) Incomplete (Id 3)

100 OSP      192.168.80/24 192.168.1.254   (65000) IGP (Id 8)

100 Dir      192.168.99/32 192.168.99.2    IGP (Id 1)

100 Dir      192.168.99.2/32 127.0.0.1     IGP (Id 1)

100 OSP      211.11.117/24 192.168.1.254   (65000) Incomplete (Id 3)



[root@callisto:~#] netstat -rn

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

224.0.0.6       127.0.0.1       255.255.255.255 UGH      40 0          0 lo

224.0.0.5       127.0.0.1       255.255.255.255 UGH      40 0          0 lo

192.168.99.0    0.0.0.0         255.255.255.255 UH       40 0          0 wp1chdlc

192.168.99.2    127.0.0.1       255.255.255.255 UGH      40 0          0 lo

127.0.0.1       0.0.0.0         255.255.255.255 UH       40 0          0 lo

192.168.99.0    0.0.0.0         255.255.255.252 U        40 0          0 wp1chdlc

172.16.0.128    192.168.14.2    255.255.255.128 UG       40 0          0 eth0

172.16.0.0      192.168.14.2    255.255.255.128 UG       40 0          0 eth0

192.168.7.0     192.168.1.254   255.255.255.0   UG       40 0          0 eth1

211.11.117.0    192.168.1.254   255.255.255.0   UG       40 0          0 eth1

10.0.0.0        192.168.14.254  255.255.255.0   UG       40 0          0 eth0

10.0.1.0        192.168.14.254  255.255.255.0   UG       40 0          0 eth0

192.168.2.0     192.168.1.254   255.255.255.0   UG       40 0          0 eth1

192.168.80.0    192.168.1.254   255.255.255.0   UG       40 0          0 eth1

192.168.1.0     0.0.0.0         255.255.255.0   U        40 0          0 eth1

192.168.14.0    0.0.0.0         255.255.255.0   U        40 0          0 eth0

192.168.44.0    192.168.1.254   255.255.255.0   UG       40 0          0 eth1

127.0.0.0       -               255.0.0.0       !         - -          - -

0.0.0.0         192.168.1.254   0.0.0.0         UG       40 0          0 eth1