Super Sparrow: Global Load Balancing Solution for Linux [Sparrow]
| Main | Code | Installation | Configuration | Paper | Contacts |

Configuration: Gated on the POP Y Router

Network Diagram

Network Diagram

Building the Configuration File

Gated is configured by editing a configuration file, /etc/gated.conf. The syntax for the gated configuration file is detailed in the Gated Documentation available from www.gated.org. The configuration to be used for this setup is annotated below.

All interfaces are passive that is Gated will not alter the preference for these connected routes:

interfaces {interface all passive; };

Set the AS number and Router ID:

autonomoussystem 64702;
routerid 192.168.193.11;

RIP, EGP and OSPF are explicitly turned off. BGP is configured with two peers, 192.168.192.13 and 192.168.193.14 with AS numbers 64700 and 64602 respectively. The first peer is configured to use multi-hop BGP by specifying the gateway for all routes learnt via this session.

rip no;
egp no;
bgp yes {
 group type External peeras 64700 {
  peer 192.168.192.13 gateway 192.168.193.14;
 } ;
 group type External peeras 64602 { peer 192.168.193.14 ; } ;
} ;
ospf no;

All routes learnt from peers with AS 64602, as well as all directly connected routes should be distributed to peers with AS 64700. In context of the BGP configuration specified above this means that 192.168.193.0/24 and any routes learnt from 192.168.193.14 will be redistributed to 192.168.192.13. Thus the peer in POP X will know about all the routes that this router can see.

export proto bgp as 64700 {
 proto bgp as 64602 { ALL metric 1; };
 proto direct { ALL metric 1; } ;
} ;

No routes should be sent to peers with AS 64602. That is this router should not send any routes to the router in Network C.

export proto bgp as 64602 { } ;

Starting Gated and Debugging

Gated can verify that the syntax of the configuration file is correct. If the following command produces no output to the terminal and exits then the config file is syntactically correct:

$ gated -C

As discussed in the configuration of Dents for the POP X router it is advantageous for routing daemons running on the route servers for Super Sparrow not to alter the kernel routing table. To effect this the -n command line option may be used. If Gated was installed from an RPM then /etc/sysconfig/gated should be edited to reflect this, otherwise when gated is run -n should be specified..

# GATED_COMMAND_LINE_OPTIONS defines command line options that
# will be passed to gated when it is started.
# 
# Uncomment the following to prevent gated from altering
# the kernel routing table

GATED_COMMAND_LINE_OPTIONS="-n"

If Gated has been installed as an RPM then it can be started using its init script:

$ /etc/rc.d/init.d/gated start
Starting gated                              [  OK  ]

Otherwise, it should be started manually:

$ /usr/sbin/gated -n

Gated should log messages to syslog. Most likely these will end up in /var/log/messages.

Running Gated on System Boot

If Gated was installed as an RPM, then chkconfig can be used to verify that the install set gated to be started on reboot:

$ chkconfig --list gated
gated           0:off   1:off   2:on    3:on    4:on    5:on    6:off
If this is not the case, then use chkconfig rectify this and then use the preceding command to verify the change.
$ chkconfig --add gated

If Gated was not installed as an RPM then adding the following to /etc/rc.d/rc.local should ensure that gated is started on system boot. The paths may need to be altered to match the installation.

if [ -x /usr/sbin/gated -a -e /etc/gated.conf ]; then
  echo Starting gated
  /usr/sbin/gated -n
fi

Gated Interactive Interface (GII)

The Gated Interactive Interface (GII) allows status information to be obtained from gated. Before accessing this service an entry for gii needs to be added to /etc/services. If Gated was installed as an RPM this is done automatically, otherwise the following should be added manually:

gii             616/tcp                         #Gated gii

The password used to grant access to this service the password for the user gii. If gated was installed from RPM this user is automatically added with an empty password forbidding access. If Gated was installed by other means then this user will need to be added.

$ /usr/sbin/useradd -c "Gated gii user" -s /bin/false gii

To set the password the passwd command. This should match the password specified in /etc/dents.xml, in the case of the example given, frub is used.

$ passwd gii
Changing password for user gii
New UNIX password: 
BAD PASSWORD: it is too short
Retype new UNIX password: 
passwd: all authentication tokens updated successfully

GII can be used to obtain a variety of information from a running Gated, including information on BGP peers:

$ telnet localhost gii
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Password? 
100 Gated Interactive Interface. Version gated-public-3_6
GateD-roger> sho bgp sum
100 Neighbor        V    AS MsgRcvd MsgSent State
100 192.168.192.13  4 64700      57      55 Established
100 192.168.193.14  4 64602      56      53 Established
100 BGP summary, 2 groups, 2 peers.

And the prefix covering a given IP address:

GateD-roger> sh ip walkup 192.168.192.10
100 BGP     192.168.192/24 192.168.193.14  (64702) 64700 64600 IGP (Id 2)
GateD-roger> quit
Connection closed by foreign host.

This is more or less analogous to the output of sho ip bgp sum and sho ip bgp 192.168.192.10 using GNU Zebra's bgpd or Cisco IOS.

Configuration File

For reference the resulting configuration file for the gated daemon is available.

POP Y Router: /etc/gated.conf.

A complete set of configuration files for this network setup can be found here.

References

Please see references.

Notes on Commands

Commands shown in paragraphs of preformated text are prefixed by the shell prompt $ to avoid confusion between commands and their output. An instruction to run the command echo flim is formated as:
$ echo flim
flim



Copyright © 2000 Horms

Last Updated: Tue May 17 17:37:17 2005