PolyDocs: Aka Usage

Web Polygraph

Aka documentation has been synchronized with Poly 2.2.2.

Aka is an IP aliases manipulation tool. We use aka to setup large number of aliases during Polygraph experiments with many robots and servers. Usage examples are available at the bottom of this page.

Aka was introduced in Poly 2.2.1.

usage: ./aka [--option ...] [interface_name] [alias]
options:
help list of options
if <str> interface name
aliases <str> ip or an ip range to set as an alias

Name:--if
Type:string
Default:no default

Specifies the name if the network interface (e.g., fxp0 or eth1). On many operating systems, you can get a list of all available interfaces by running


	example> ifconfig -a

Note that you can just put the interface name after all other options (see aka's usage line).

Interface name must be specified.

Name:--aliases
Type:string (IP address or IP range)
Default:no default

The aliases option specifies what alias or aliases you want to have on the given interface. Aka recognizes IP addresses in PGL address format, including dotted IP range. Aka will try to specify the subnet or you can use an explicit subnet specification.

The number of aliases you can set depends on your OS. Moreover, some OSes may support large number of aliases (more than 1000) but with a significant performance penalty. In our FreeBSD environment, 500 aliases seems to be the limit after which noticeable network performance degradation occurs.

Note that you can just put alias specs after all other options and the interface name (see aka's usage line).

Aka will delete all old aliases before setting new ones. If you do not specify the new aliases, the old ones will still be deleted (handy for cleaning up after yourself).

Examples

Here is an example. Let's configure fxp0 interface on a FreeBSD box to have 500 aliases in a class B network.

First, let's check what aliases are already defined for fxp0 using ifconfig command:


        example> ifconfig fxp0
	fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet 10.0.1.105 netmask 0xffffff00 broadcast 10.0.1.255
	inet 10.150.15.10 netmask 0xffffff00 broadcast 10.150.15.255
	ether 00:10:dc:7c:3d:f8 
	media: autoselect
	supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP
The output tells us that 10.0.1.105 is the primary address of the interface, and 10.150.15.10 is the only alias currently assigned to fxp0.

We will now set fxp0 aliases to 10.200.1-2.1-250. That is, we want to add these 500 aliases:


	10.200.1.1 .. 10.200.1.250
	10.200.2.1 .. 10.200.2.250

From the IP range specs, aka can guess that we probably need a /16 subnet. If you need a different subnet, say /20, you should use 10.200.1-2.1-250/20 aliases format. Finally, you must run aka as a root; we will use sudo command for that, but you can use your favorite method of running a command under root. Here is the command that sets all 500 aliases:


	example> sudo ./aka fxp0 10.200.1-2.1-250
	fxp0: reseting aliases to 10.200.1-2.1-250
	fxp0: primary address is 10.0.1.105 broadcast 10.0.1.255
	fxp0: found 1 old aliases.
	fxp0: deleted 1 old aliases.
	fxp0: created 500 new aliases.

Note that the old alias was deleted. Now let's double check the results using ifconfig command:


	example> ifconfig fxp0
	fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet 10.0.1.105 netmask 0xffffff00 broadcast 10.0.1.255
	inet 10.200.1.1 netmask 0xffff0000 broadcast 10.200.255.255
	inet 10.200.1.2 netmask 0xffff0000 broadcast 10.200.255.255
	inet 10.200.1.3 netmask 0xffff0000 broadcast 10.200.255.255
	...
	inet 10.200.2.249 netmask 0xffff0000 broadcast 10.200.255.255
	inet 10.200.2.250 netmask 0xffff0000 broadcast 10.200.255.255
	ether 00:10:dc:7c:3d:f8 
	media: autoselect
	supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP

All 500 aliases were indeed successfully added with correct netmask and broadcast fields. Now you can add the same IP range specs to your PGL configuration file (see hosts field of agent PGL type) so that Polygraph will start robots or servers on the corresponding IPs.

Depending on your OS, you may also need to setup appropriate network routes using route or similar commands. FreeBSD usually does not require such a step (routes are set auto-magically when you change aliases).

We finish with a note that aka tool is not required to manipulate aliases. Ifconfig or similar tools that come with your OS can be used as well. The only advantage of aka is that it can add many aliases without a need to write a shell script or manually add aliases one-by-one.



$Id: aka.sml,v 1.3 1999/10/19 18:43:21 rousskov Exp $