Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Steel-Belted Radius Carrier Node Administration Scripts

 

Several types of scripts effect different areas of SBR Carrier operation.

Using IP Address and IP Address Pool Scripts

Using IP Address and IP Address Pool Scripts

To set up or modify the IP Address Pool, you use specific administration scripts that modify the IP Address Pool table in the SSR database. You must place all Steel-Belted Radius Carrier nodes into management mode before you work on the IP address tables. When a SBR Carrier node is in management mode, caching is disabled, and that slows down performance, so we recommend that you schedule IP pool maintenance for off-peak hours.

You can modify configuration parameters (other than the ManagementMode parameter in dbclusterndb.gen) without putting the servers into management mode. When you change other settings on the Steel-Belted Radius Carrier node, the server enters and exits management mode silently when appropriate.

You must place all of the cluster’s SBR Carrier nodes in management mode to execute these scripts because they write IP address information into the database:

You can execute these IP-related scripts without entering management mode because they do not write information to the database:

Using Management Mode

Using Management Mode

You must place all SBR Carrier servers that are the front end for a SSR cluster into management mode before you modify any part of the SSR IP address tables.

Placing a SBR Carrier Server into Management Mode

To place a SBR Carrier server into management mode, as root:

  1. Edit /opt/JNPRsbr/radius/dbclusterndb.gen.

    Scroll down the file past the opening comments and the management mode comments to the ManagementMode entry:

  2. Set the value of the ManagementMode parameter to 1.

    Save the file.

  3. Restart the process.

    Either:

    • Execute a HUP command.

    • Execute: /opt/JNPRsbr/radius/sbrd hup.

  4. Scan or tail the server log to confirm that it contains this entry:

    DB Cluster plugin has entered Management Mode

  5. Repeat this procedure on each SBR Carrier node in the cluster before executing the IP address database command scripts.

Removing a SBR Carrier Server from Management Mode

Remove all SBR Carrier servers associated with an SSR cluster from management mode after you reconfigure your SSR IP address tables. To remove a SBR Carrier server from management mode:

To place a SBR Carrier server into management mode, as root:

  1. Edit /opt/JNPRsbr/radius/dbclusterndb.gen.

    Scroll down the file past the opening comments and the management mode comments to the ManagementMode entry:

  2. Set the value of the ManagementMode parameter to 0.

    Save the file.

  3. Restart the process.

    Either:

    • Execute a HUP command.

    • Execute: /opt/JNPRsbr/radius/sbrd hup.

  4. Scan or tail the server log to confirm that it contains this entry:

    DB Cluster plugin has left Management Mode

  5. Repeat this procedure on each SBR Carrier node in the cluster.

ClearCache.sh

ClearCache.sh

The ClearCache.sh script lets you mark the cached addresses associated with a specified SSR node (or all cached addresses) as uncached.

Syntax

All SBR Carrier nodes must be in management mode before you execute this script.

Options

Table 83: ClearCache.sh Options

Option

Description

-a

Specifies that all cached addresses should be marked uncached.

nodeid

Specifies that all cached addresses associated with the specified SSR node should be marked as uncached.

The value you enter for nodeid is the SSR node identifier specified in the config.ini file on the database management server.

-h

Displays help for the ClearCache.sh script.

Example

The following example (1) uses the ShowAddrs.sh script to list the address cache list for Node 24, which contains four IP addresses; (2) uses the ClearCache.sh script to clear the address cache for Node 24; and (3) uses the ShowAddrs.sh script to show that no IP addresses remain in the address cache list for Node 24.

Usage Notes

The ClearCache.sh script is intended for use in situations where a SBR Carrier server has failed and you want to recover the addresses associated with the node. If you execute the ClearCache.sh script against an operational node, SBR Carrier cannot track which addresses from that node have been issued, potentially resulting in addresses being assigned to more than one user.

ShowCaches.sh

ShowCaches.sh

The ShowCaches.sh script enables you to display detailed information about IP address pool caches.

Syntax

Options

Table 84: ShowCaches.sh Options

Option

Description

-h

Displays help for the ShowCaches.sh script.

Example

The following example shows the combined output of the ShowCaches.sh script and the ShowPools.sh script using the -r option.

This output shows five pools and ten ranges. There are three SBR Carrier servers attached to the cluster (node IDs 30, 31, and 32). It also shows the state right after all three SBR Carrier servers have been booted, with each node caching its “high-water mark” of addresses, and no addresses yet “in use”.

Node 30 has a high-water mark of 250 for each pool, Node 31 has 150, and Node 32 has 200. The “%Cache” column in the ShowPools.sh script is cumulative over SBR Carrier servers, while “%Cache” in the ShowCaches.sh script is per-SBR Carrier server (finer granularity); the latter adds up to the former, for each pool.

AddPool.sh

AddPool.sh

The AddPool.sh script adds a named IP address pool to the IpPools database table.

Syntax

All SBR Carrier nodes must be in management mode.

Options

Table 85: AddPool.sh Options

Option

Description

poolname

Address pool names can be entered in lower, mixed, or upper case, but names are converted to all capitals before the pool is created. User-created address pool names cannot include spaces or tab characters.

-h

Displays help for the AddPool.sh script.

Example

To add an IP address pool called GOLD to the database and then show it, enter the following commands:

Usage Notes

  • When an IP address pool is created, the script assigns the pool a permanent identification number (“ordinal”) in the range 1–65535. Ordinals are assigned in “wrap-around” fashion, where ordinals of increasing values are used before ordinals of lower value are re-used. When ordinals wrap around, values that are still in use are skipped.

  • Ordinal number 0 is reserved for the zombie address pool.

RenamePool.sh

RenamePool.sh

The RenamePool.sh script enables you to change the name assigned to an IP address pool in the IpPools database table. The RenamePool.sh script does not change the status of IP address ranges associated with a pool or the status of IP addresses in the pool. You cannot rename a zombie pool.

Syntax

All SBR Carrier nodes must be in management mode.

Options

Table 86: RenamePool.sh Options

Option

Description

oldname

Current name of the IP address pool that you want to rename.

newname

New name you want to assign to the IP address pool.

Address pool names can be entered in lower, mixed, or upper case, but names are converted to all capitals before the pool is created. User-created address pool names cannot include spaces or tab characters.

-h

Displays help for the RenamePool.sh script.

Example

The following example lists the address pools configured for Steel-Belted Radius Carrier high availability, changes the name of the GLOD pool to GOLD, and confirms the correction was accepted.

DelPool.sh

DelPool.sh

The DelPool.sh script enables you to delete an IP address pool in the IpPools database table. When you use the DelPool.sh script to delete an address pool, Steel-Belted Radius Carrier high availability moves the IP addresses in that pool to the zombie pool to preserve their usage statistics.

Syntax

All SBR Carrier nodes must be in management mode.

Options

Table 87: DelPools.sh Options

Option

Description

poolname

Name of the IP address pool that you want to delete.

-a

Deletes all IP address pools in the IpPools database and corresponding ranges from the IpRanges table.

-z

Indicates whether zombie addresses are to be created.

-h

Displays help for the DelPool.sh script.

Example

The following example lists the address pools configured for Steel-Belted Radius Carrier high availability, deletes the C-SILVER address pool, and confirms the correction was accepted.

Usage Notes

You cannot delete the zombie pool.

ShowPools.sh

ShowPools.sh

The ShowPools.sh script displays the name and ordinal number of a specified IP address pool or all IP address pools, along with statistics for how many addresses are configured in the pool and how many addresses are currently in an available, cached, or assigned state.

Syntax

Options

Table 88: ShowPools.sh Options

Option

Description

-v

Displays output in percentages for the ShowPools.sh command in verbose mode. The percentages always add to 100% per pool.

-r

Displays output in raw numbers instead of percentages. When invoked with the -v option, you can use any format: -vr, -rv, -v -r, or -r -v.

If the -r option is used without the -v option, the command is ignored.

-p Poolname

Displays output of the specified IP address pool in raw numbers, when invoked with the -r, -vr, -rv, -v -r, or -r -v option. The output also contains the statistics for the total number of IP pools, pool ranges, and IP addresses in the database.

When invoked with the -v option, this script displays the output of the specified IP address pool in percentages.

Note: The exact pool name should be used for Poolname. Wildcard characters (such as *) are not allowed in the script.

-h

Displays help for the ShowPools.sh script.

Example

The following example lists the address pools configured for Steel-Belted Radius Carrier high availability.

Usage Notes

  • The output of the ShowPools.sh script is sorted alphabetically by pool name.

  • The Count field displays the total number of IP addresses in the pool. If an address pool consists of more than one address range, the Count field displays the sum of the number of addresses in each range. When the Count field is zero, the percentage fields are represented with dashes because the quotient InUse/Count does not exist.

  • The Free, Cache, and InUse fields, which are populated when the -v (verbose) option is used, display the percentage of addresses in an address pool that are in each state.

    • The Free field displays the percentage of addresses that are available for caching or assignment.

    • The Cache field displays the percentage of addresses that have been cached by a Steel-Belted Radius Carrier node.

    • The InUse field displays the percentage of addresses in the pool that are currently assigned to users.

AddRange.sh

AddRange.sh

The AddRange.sh script adds an IP address range to the IpRanges database table. The new range cannot intersect with an existing range. If no zombie addresses exist in the new range, the AddRange.sh script will run quickly; otherwise it will run slowly.

Syntax

All SBR Carrier nodes must be in management mode.

Options

Table 89: AddRange.sh Options

Option

Description

poolname

Specifies the name of the IP address pool to which you want to add an IP address range.

Address pool names can be entered in lower, mixed, or upper case, but names are converted to all capitals before the script continues.

startaddr

Specifies the first IP address in the IP address range.

Enter IP addresses in dotted decimal format.

count

Specifies the number of addresses in the address range.

You must enter a count argument if you do not enter an endaddr argument.

endaddr

Specifies the last IP address in the IP address range. Enter IP addresses in dotted decimal format.

You must enter an endaddr argument if you do not enter a count argument.

-u

“Unzombifies” the addresses in the Current Sessions Table and updates the corresponding Sbr_IpPoolOrdinal’s in the Current Sessions Table.

-h

Displays help for the AddRange.sh script.

Example

The following example adds an address range consisting of 15 addresses to the B-GOLD pool and confirms the address range was added.

Usage Notes

When the AddRange.sh script is executed, it determines the status of the addresses in the range. If the addresses do not exist in the IpAddrs database table, the AddRange.sh script adds them to the table. If the addresses exist in the IpAddrs database table and are flagged as zombies, the script updates the pool ordinal of each address to reflect its address pool assignment.

DelRange.sh

DelRange.sh

The DelRange.sh script enables you to delete an IP address range from the IpRanges database table and delete the addresses in the IP address range from the IpAddrs database table.

Syntax

All SBR Carrier nodes must be in management mode.

Options

Table 90: DelRange.sh Options

Option

Description

startaddr

Specifies the starting IP address of the range you want to delete.

-a

Deletes all ranges.

-z

Indicates whether zombie IP addresses were created.

-h

Displays help for the DelRange.sh script.

Example

The following example removes the address range starting with 192.168.0.0 from the B-GOLD pool and confirms the address range was deleted.

Usage Notes

  • You are not prompted to confirm that you want to delete an address range when you execute the DelRange.sh command.

  • When you execute the DelRange.sh script, Steel-Belted Radius Carrier high availability transfers the addresses in the deleted range to the zombie pool to preserve their usage statistics.

  • Put your SBR Carrier servers into management mode before you execute DelRange.sh.

ShowRanges.sh

ShowRanges.sh

The ShowRanges.sh script enables you to display the starting and ending address of each IP address range, the number of addresses in the range, and the name of the pool to which a range belongs.

Syntax

Options

Table 91: ShowRanges.sh Options

Option

Description

-r

Orders the range primarily by range start/end addresses, and secondarily by pool name.

-c

Orders the range primarily by count, and secondarily by range or pool name according to how the -r argument was specified.

-h

Displays help for the ShowRanges.sh script.

Example

The following example displays the output of the ShowRanges.sh script, which indicates that the B-GOLD IP address pool consists of one range of 15 IP addresses.

Usage Notes

  • The output of the ShowRanges.sh script is sorted alphabetically by pool name, with ranges within an address pool being sorted numerically.

  • IP addresses in the output of the ShowRanges.sh script are padded with spaces to improve readability. Before you can use an IP address copied from the ShowRanges.sh output as an argument for another command (such as AddRange.sh, DelRange.sh, DelSession.sh, ShowAddrs.sh, or ShowSessions.sh), you must remove the embedded spaces.

KillZombieAddrs.sh

KillZombieAddrs.sh

A zombie address or pseudo-address is an entry in the IpAddrs database table that is not associated to any pool defined in the IpPools database table. A zombie pool is defined in the ipAddrs database table and given an ordinal number of 0 with the name “(z o m b i e)”. No other pool can have space-characters or lowercase characters in its name.

When you change pool settings, some addresses may be shuffled amongst different address pools. As a result, some addresses may become disassociated from any defined pool. These zombie addresses are held in the zombie pool (a temporary holding tank for addresses not currently assigned to a pool). The zombie pool preserves the LastUse timestamp on these addresses to support SSR aging strategy, which enables the addresses to be moved from one pool to another.

The KillZombieAddrs.sh script deletes all zombie addresses from the IpAddrs and IpRanges database tables and the zombie address pool. After completing the reconfiguration, if you do not want to preserve the usage statistics for the affected addresses, run the KillZombieAddrs.sh script to delete the IP address pools or ranges (Steel-Belted Radius Carrier high availability puts the affected IP addresses in the zombie address pool). The KillZombieAddrs.sh script also updates the IpPools database table to remove zombie address information.

You cannot remove selected addresses (while leaving others) with the KillZombieAddrs.sh script.

Syntax

All SBR Carrier nodes must be in management mode.

Options

Table 92: KillZombieAddrs.sh Options

Option

Description

-h

Displays help for the KillZombieAddrs.sh script.

Example

The following example displays the output of the ShowPools.sh and ShowAddrs.sh scripts before and after the KillZombieAddrs.sh script is executed.

ShowAddrs.sh

ShowAddrs.sh

The ShowAddrs.sh script enables you to display the contents of the IpAddrs database table.

Syntax

Options

Table 93: ShowAddrs.sh Options

Option

Description

-a

If the -a argument is entered, information about IP addresses associated with all nodes is displayed.

startaddr

If used without an endaddr argument, only information about the specified address is displayed.

If used with an endaddr argument, only information about addresses in the specified address range is displayed.

If used with the count argument but without an endaddr argument, only addresses within the startaddr...startaddr+count-1 are displayed.

count

Specifies the number of addresses in the address range.

endaddr

Specifies that only information about addresses in the address range between startaddr and endaddr is displayed.

You cannot use the endaddr argument without a startaddr argument.

-o

Displays the output as an unordered list. You can use this argument when the IpAddr table is very, very large and you want to maximize efficiency.

If used with a startaddr argument, displays only that address only.

If used with startaddr and endaddr arguments, displays only those addresses between the specified address range.

If used with the count argument and an addr argument, only addresses within the startaddr...startaddr+count-1 are displayed.

-h

Displays help for the ShowRanges.sh script.

Example

The following example displays the output of the ShowAddrs.sh script, which lists the status of each IP address configured in the Steel-Belted Radius Carrier high availability database. The following example indicates that node 24 has four IP addresses in its cache, that node 23 has three IP addresses in its cache, and that one IP address is currently in use by node 24.

Output Notes

Table 94: ShowAddrs.sh Output Fields

Field

Description

IPAddress

Identifies the IP address in dotted-decimal format (with space padding for readability).

Pool

Identifies the pool using the IP address.

Cache

Identifies the SSR node ID of the SBR Carrier server that has cached the IP address. A value of 0 indicates the address is not cached.

InUse

Identifies the SSR node ID of the SBR Carrier server that assigned the IP address to a user.

LastUse

If the address is in a cache (if the Cache field is not 0), identifies the date and time on which the IP address was last cached by a server.

If the address is currently assigned to a user (if the InUse field is not 0), identifies the date and time on which the IP address was assigned to the user or on which the time stamp was updated.

If the address is currently available (if the Cache and InUse fields are 0), identifies the date and time on which the IP address was freed at the end of a user session.

Usage Notes

If SBR Carrier does not receive an Accounting-Stop message for an address in the InUse column, it does not return the address to the pool of available addresses immediately. SBR Carrier sweeps the Current Sessions Table periodically for stale sessions, where the StaleSessionTimeoutSecs setting in radius.ini specifies the period. To remove an address from the InUse column manually, use the DelSession.sh command.

BackupIP.sh

BackupIP.sh

The script enables you to create a backup of IP address pools in your SSR database. You can make multiple backup copies using this script. During the backup process, the values of Cache and InUse columns in the database are set to 0 in order to aid the restoration of the IP address pools after the database creation.

Syntax

Options

Table 95: BackupIP.sh Options

Option

Description

filename

Specifies the filename in which you want to backup IP address pools.

-h

Displays help for the BackupIP.sh script.

Example

The following example (1) lists the address pools configured for Steel-Belted Radius Carrier high availability and (2) creates a backup of the address pools in the filename called Backup1.

Usage Notes

The backed up file can be restored using the RestoreIP.sh script.

RestoreIP.sh

RestoreIP.sh

The script enables you to restore the IP address pools from the backup file you created in your SSR database.

Syntax

Options

Table 96: RestoreIP.sh Options

Option

Description

filename

Specifies the filename that contains the backup.

-h

Displays help for the RestoreIP.sh script.

Example

The following example displays the output of the ShowPools.sh script before and after the RestoreIP.sh script is executed.

Usage Notes

Executing the RestoreIP.sh script deletes the existing database, creates a new database, and restores the IP address pools from the backup file you created in your SSR database.

The values in the ord column may get changed after restoring the IP pools.

Note

Place the SBR Carrier servers into management mode before you execute RestoreIP.sh.