Solaris Bandwidth Manager 1.5 Administration Guide

Chapter 4 Editing the Configuration Files

This chapter decribes how to edit the Solaris Bandwidth Manager configuration files directly, using a text editor. To edit the configuration files using batool, see Chapter 5, Configuring Solaris Bandwidth Manager Using batool.

The following definitions are specified in the main Solaris Bandwidth Manager configuration file:

Each definition contains both mandatory and optional parameters, which can be edited to suit your configuration requirements.

You can also edit the agent properties file, if neccessary for your configuration.

You must log into the machine running Solaris Bandwidth Manager as root or become superuser in order to carry out any configuration.

Configuration Overview

To configure Solaris Bandwidth Manager you must create a group of classes that will be used to determine how network traffic is handled. Classes are defined in terms of the filters that are used to allocate traffic to a particular class, and filters are composed of a a number of elements. Therefore, you must create both the filter elements and filters you require before you can create classes. All classes are assigned to a particular physical interface, so you must also define the interface(s) that you want to use in your configuration.

The Solaris Bandwidth Manager configuration file cannot contain forward references, so you must configure the definitions in the following order:

The rest of this chapter describes the files and directories used to hold configuration information, and explains how to specify the configuration you want by editing the files directly.

Configuration Files and Directories

The file /etc/opt/SUNWconn/ba/ba_config.location indicates the location of the configuration file currently being used. This can be done by specifying:

When the Solaris Bandwidth Manager policy agent starts, it reads the file named in ba_config.location. If ba_config.location does not exist or cannot be read, the policy agent assumes that the configuration file is ba.conf. If the configuration changes while the policy agent is running, it can be re-read by the policy agent (see "Dynamic Reconfiguration").

The directory /etc/opt/SUNWconn/ba also contains the following files:

Configuration File Format

The Solaris Bandwidth Manager configuration file contains general configuration parameters and a number of definitions used to allocate bandwidth to network traffic. These definitions can be included in any order, but forward references to other definitions are not permitted.

The file contains definitions for the following items:

A definition is terminated by the keyword indicating the start of the next definition or by the end of the file. Within a definition there is a series of keywords and their values. Class names and filter names must not exceed 20 characters.

Some keywords can take only one value but can be present more than once in a subsection. Other keywords can take more than one value, in a list separated by commas. A value cannot contain a comma. If the list of values for a keyword continues over more than one line, use a backslash (\) as a continuation character. A value can contain a backslash, unless the backslash is the last character in the line, in which case it is treated as a continuation character.

You can include comment lines, starting with a pound sign (#). All lines starting with a hash sign are treated as comments, however, a value can contain a hash sign. Within a comment line, any characters are permitted.

You must be root in order to edit this file.

General Configuration Parameters

The configuration file contains the following general parameters:

URL Group Definition

A URL group definition is a list of one or more URLs (Uniform Resource Locator).

Format

url_group   name
                     url   url_address

The following characters are restricted, and must be entered as an ascii code, preceded by a percent (%) sign:

character 

ascii code 

25 

40 

3A 

2C 

23 

The / character can only be used as part of a path.

Example

url_group   web_sun_group
            url   http://www.sun.com/*.html
            url   http://www.sun.com/*.gif
            url   http://*:8080/~mylogin
            url   ftp://ftp.sun.com/*

Host Group Definition

A host group is a list of IP addresses (in dot format) or host names that will be resolved by the host's database on the system where Solaris Bandwidth Manager is running.

Format

host_group   name
             address   address_list
          

Example

host_group   grp_sales
             address   134.xxx.yyy.1, 134.xxx.yyy.2
host_group   grp_paris
             address   125.xxx.yyy.1, 125.xxx.yyy.2, apple, pear,\
                       orange
          

Subnet Group Definition

A subnet group is a list of IP addresses (in dot format) or network names that will be resolved by the host's database of the system running Solaris Bandwidth Manager or by the networks table. A subnet group also contains a subnet mask.

Format

subnet_group   name
               address   address_list
               mask      subnet_mask

Example

subnet_group   grp_nets
               address   129.xxx.yyy.0, plum
               mask      225.225.225.0

Service Definition

A service definition provides a mapping between a service defined in application layer terms and the protocol and ports used. This includes control protocols such as PIM, RSVP, and IGMP. A number of services are pre-defined in the file /opt/SUNWconn/ba/lib/services.def. "Complete Configuration" shows the pre-defined services.

Format

service   name
          protocol   protocol
          ports      local_port,remote_port

Example

service   tv
          protocol   tcp
          ports      2023,*
          ports      2024,*
          ports      *,2023
          ports      *,2024

Filter Definition

A filter contains local and remote information and a service, and is used to determine the class of a packet. It can also contain URL information and a Type of Service value.

Format

filter   name
         local
                         type      type
                         local_info
         remote
                         type      type
                         remote_info
         url
                         type      urltype
                         url_info
        tos_match        tos_match
        tos_match_mask   tos_match_mask
        service          service

Examples

filter   filter1
         local
                         type      host
                         address   apricot
         remote
                         type      host_group
                         name      grp_sales
         tos_match       0x03
         tos_match_mask  0x0F
         service         ftp,http
filter   filter2
         local
                         type      subnet_group
                         name      grp_nets
         remote
                         type      subnet
                         address   129.xxx.yyy.0
                         mask      255.255.255.0
         url
                         type      url_group
                         name      web_sun_group
         service         http

Interface Definition

An interface definition specifies a Solaris device name, its flow direction, and the bandwidth to be associated with it.

Format

interface   name
            rate         bandwidth
            activate     status
            router_addr  router_addr
            router_mac   router_mac
            network      network_device
            multicast    multicast
            nonip_mode   non_ipmode

IP-Transparent Mode

If you are using Solaris Bandwidth Manager in IP-Transparent mode, you must specify the router_addr, network and router_mac keywords.

The following parameters are optional in IP-Transparent mode:

Example

interface   qe0_out
            rate         512000
            activate     enabled
            router_addr  134.xxx.yyy.3
            router_mac   809xxxxx
            network      le0
            multicast    all
            nonip_mode   ipqos

Class Definition

A class definition contains the parameters for the class, including the filters that cause packets to be placed in this class.

Format

class   name
        parent             parent_class
        interface          interface
        bandwidth          bandwidth
        max_bandwidth      max_bandwidth
        priority           priority
        bandwidth_bps      bandwidth_bps
        max_bandwidth_bps  max_bandwidth_bps
        tos_mark           tos_mark
        tos_mark_mask      tos_mark_mask
        flow_events        flow_events
        filter             filter

Example

class   test_class
        parent             root
        interface          qe0_out
        bandwidth          35
        max_bandwidth      45
        priority           3
        tos_mark           0x07
        tos_mark_mask      0x0F
        flow_events        ip_source
        filter             filter1,filter2

Type of Service Values

Solaris Bandwidth Manager uses the TOS byte in the following ways:

Table 4-1 Type of Service Values and Their Meanings

1000 

minimize delay 

0100 

maximize throughput 

0010 

maximize reliability 

0001 

minimize monetary cost 

0000 

normal service 

The classification criterion in filters is defined by the tos_match and the tos_match_mask parameters. tos_match_mask is a bitmask that defines which bits of the TOS byte need to be checked. tos_match is the value to check.

For example, to filter all packets whose TOS byte is "minimize delay" and "normal service" (xxx 1xx0 x): tos_match_mask must be set to 000 1001 0 (0x12), and tos_match must be set to 000 1000 0 (0x10).

In classes, the following parameters are used: tos_mark_mask, and tos_mark. tos_mark_mask is a bitmask defining which bits to modify in the TOS byte, and tos_mark is the value to apply.

Agent Properties File Format

To edit the agent properties file, you require root access to the system running Solaris Bandwidth Manager. The file is called agent.properties, and is located in the /etc/opt/SUNWconn/ba directory. The parameters it contains are:

Configuration Examples

This section contains some examples of configuration files, based on the "Configuration Planning Example".

IP-Transparent Mode Interface Configuration

Figure 4-1 IP-Transparent Configuration at London Site

Graphic

In IP-transparent mode, the host running Solaris Bandwidth Manager sits between the traffic source (usually a LAN) and the router. On the host shown in Figure 4-1, you configure the qe1_out interface for Solaris Bandwidth Manager, giving le0 as the network device. For example:

interface   qe0_out
            rate          512000
            activate      enabled
            router_addr   123.xxx.yyy.1
            network       le0
            router_mac    809xxxxx
            multicast     all

In addition to the configuration shown above, you must configure a standard IP interface for the network interface to the LAN. This is necessary for the interface to be inserted into the IP stack at boot time. Create the file /etc/hostname.interfacename with a reference to the IP address of the interface.


Note -

Do not configure the network interface on the WAN side. Run ifconfig -a and check that there is no reference to this interface.


Server Mode Interface Configuration

Figure 4-2 Interfaces Configuration at Paris Site

Graphic

In this example, the host running Solaris Bandwidth Manager is acting as a router and there are two interfaces. le0 is the interface used when sending network traffic to London, and ipdptp1 is a PPP interface used when sending network traffic to Bonn. The configurations for both interfaces are normal server mode configurations. For example:

interface   le0_out
            rate       263144
            activate   enabled
interface   ipdptp1_in
            rate       65536
            activate   enabled

Logical Interfaces

Figure 4-3 Configuring Logical Interfaces

Graphic

Solaris Bandwidth Manager operates at the level of the physical interface (le0) and does not recognize logical interfaces (le0:1 and le0:2, for example). If your IP configuration includes logical interfaces, you can use the class hierarchy to subdivide network traffic according to the destination subnet, and then manage the traffic for each subnet separately. Figure 4-3 shows a configuration with two logical interfaces. The configuration file contains a definition for the le0 interface, and filter and class definitions for the subnet1 and subnet2 classes. For example:

filter    subnet1
          remote
                   type            subnet
                   address         123.xxx.yyy.0
                   mask            255.255.255.0

filter    subnet2
          remote
                   type            subnet
                   address         123.xxx.zzz.0
                   mask            255.255.255.0

interface le0
                   rate            263144
                   activate        enabled

class     subnet1
                   parent          root
                   interface       le0_in
                   bandwidth       60
                   priority        3
                   max_bandwidth   100
                   filter          subnet1

class     subnet2
                   parent          root
                   interface       le0_in
                   bandwidth       40
                   priority        3
                   max_bandwidth   100
                   filter          subnet2                  

Complete Configuration

The following file implements the configuration described for the Paris server in "Configuration Planning Example". Note that two filters, imap and smtp, have been used to define the class email.

# Sample configuration file for Paris site



version 1.5
timeout 30

#Subnet Group definitions

subnet_group bonn
        address         129.xxx.xxx, 129.xxx.yyy
        mask            225.225.225.0

subnet_group paris
        address         129.yyy.xxx, 129.yyy.yyy, 129.yyy.zzz
        mask            225.225.225.0

subnet_group london
        address         129.zzz.xxx, 129.zzz.yyy
        mask            225.225.225.0

#Filter definitions

filter http_to_london
        local
                type    subnet_group
                name    paris
        remote
                type    subnet_group
                name    london
        service         http

filter telnet
        service         telnet

filter imap
        service         imap

filter http_to_bonn
        local
                type    subnet_group
                name    paris
        remote
                type    subnet_group
                name    bonn
        service         http
filter snmp
        service         snmp

filter http
        service         http

filter ftp
        service         ftp

filter smtp
        service         smtp

#Interface defintions for qe0_out

interface qe0_out
        rate            128000
        activate        enabled


#Class definitions for interface qe0_out

class ftp
        interface       qe0_out
        parent          root
        filter          ftp
        bandwidth       15
        priority        7
        max_bandwidth   15

class email
        interface       qe0_out
        parent          root
        filter          imap, smtp
        bandwidth       20
        priority        7
        max_bandwidth   20

class snmp
        interface       qe0_out
        parent          root
        filter          telnet
        bandwidth       5
        priority        1
        max_bandwidth   5

class telnet
        interface       qe0_out
        parent          root
        filter          telnet
        bandwidth       30
        priority        1
        max_bandwidth   30

class http
        interface       qe0_out
        parent          root
        filter          http
        bandwidth       20
        priority        5
        max_bandwidth   20

class http_bonn
        interface       qe0_out
        parent          http
        filter          http_to_bonn
        bandwidth       5
        priority        3
        max_bandwidth   5

class http_london
        interface       qe0_out
        parent          http
        filter          http_to_london
        bandwidth       10
        priority        3
        max_bandwidth   10

class default
        interface       qe0_out
        bandwidth       0
        priority        7
        max_bandwidth   0

#Interface definition for qe0_in

interface qe0_in
        rate            0
        activate        enabled

#Class definition for interface qe0_in

class default
        interface       qe0_in
        bandwidth       0
        priority        7
        max_bandwidth   0