Legacy productThe WF1740 described here is an old product and no longer supplied. Please see details of current FireBrick products.
FireBrick 105
Manuals
Home
Setup Users Status Profiles Shape Speed Subnet Route IP Port Filters Mapping Tunnel

FireBrick 105 Scripted access

The only configuration access to the FireBrick is via the web interface. However, there are a number of examples of cases where some automated access is required, e.g. configuring many FireBricks at ones; uploading new softtware to many FireBricks; or automated saving of configs from many FireBricks.

This page gives a basic outline of the way in which you can access FireBricks using scripts. These scripts assume you have access to curl which is a standard web page access function. Curl is standard on linux and is available for windows as well.

Except for config and software loading, all access is normal HTTP port 80 GET commands which may have a number of arguments in normal URL encoding. You can work out most commands and parameters by simple inspection of the web page source.

Using Curl

Curl has many arguments. In most examples here the arguments used are as follows :-
-s
Silent - don't print progress stats
-f
Fail silently on errors
-G
Do GET instead of POST
-d tag=value
Specify an argment to be sent
-o /dev/null
Do not actually write the output anywhere
http://iporname/1/
The URL and session for the FireBrick

Login

Before you can access settings you must log in. Once logged in, all web page accesses much be from the same IP address.  Also, they must also have the same session ID. If you are writing a script, the login is the first step.

Session

The session ID is a number that appears as a directory in front of the actual page name. e.g. http://my.firebrick.co.uk/1/main is accessing main with session ID 1. Normally when you access the FireBrick, a random session ID is allocated. However, you can pick a fixed number, such as 1, if you like, and use this throughout your script.

Logging in

dologin
user
User name
pass
Password

curl -s -f -G -o /dev/null -d user=admin -d pass=fred http://my.firebrick.co.uk/1/dologin

Info

Often, having logged in, the info function is useful. This produces a file (use -o filename, or use stdout to get the file). The file contains a number of values each of the form of a letter, =, and a string, on a line by itself. Using and grep and sed these can be extracted easily.

The key values are:-
L
Language, normally EN
O
OEM/user interface, normally FB
This is relevant when upgrading software
S
Serial number
Often used as a file name in saved configs, etc
V
Version number
N
Version name
E
Internal electronic serial number
M
Base MAC address
I
Number of MACs (always 23)

Basic settings changes

To change settings, you must perform a GET on a command for the relevant settings, e.g. filter. The full range of arguments to this can be seen by inspection of the HTML for the edit page. You must not omit any settings.

filter
i
The filter number minus 1, e.g. for filter 1, i=0
This is common to most settings
g
The page number minus 1 - this shows the right page on Save so can be omitted
N
Filter name
This is common to most settings
A
Security access level, minus 1 (i.e. 0 to 7)
This is common to most settings
TP
The time profile. This is the profile number, 1 to 100
Profile 0 is 24/7
Profile 101 is 9-5 M-F
Profile 102 is 2am Sunday
Add 103 to the profile number to set Not the profile
This is common to most settings
SAVE
Save, this is set to the string Save to cause the settings to be saved
ISL
IP Source first address
ITL
IP Target first address
ISG
IP Source group number, or 0 for not applied
ITG
IP Target group number, or 0 for not applied
ISH
IP Source last address, or netmask or bit count
ITH
IP Target last address, or netmask or bit count
PSL
Source port first address
PTL
Target port first address
PSH
Source port last address
PTH
Targte port last address
PPG
Port/protocol group number, or 0 for not applied
IS
Interface, source (intterface number, dot sub interface), see interfaces
IT
Interface, target
Z
Action, 1=Aloow, 0=Drop, 2=Reject, 3=Bounce
T1
Initial timeout, or 0 for default
T2
Ongoing timeout, or 0 for default
TV
TOS value
TM
TOS mask
O
Options, either multiple O= entries for each bit, e.g. O=16 for Log, etc, or one O= value with the sum of the bit values
O2
Options2, more options, see HTML

Saving config

To save a configuration, access download. e.g.:-

curl -s -f -o config.bin http://my.firebrick.co.uk/1/download


Always check that the file was created and is not zero length. Do not overwrite previous versions directly - check first. Any error in permissions, etc, may generate a zero length file.

Uploading config

To upload a config you need to make a POST containing the config file to upload with the file argument UPLOAD. e.g.

curl -s -f -o /dev/null -F UPLOAD=@config.dat http://my.firebrick.co.uk/1/upload

It is recommended you do a login again after the upload.

Uploading software

To upload software you do the same as config, but using the softare. First upload the F file, e.g.

curl -s -f -o /dev/null -F UPLOAD=@1740_2-02-569-Salorch.F http://my.firebrick.co.uk/1/upload

You then have to wait for it to finish flashing. You may simply want to make the next connand use --connect-timeout 60 in curl. It is recommended you do a login again after the upload. e.g.

curl -s -f --connect-timeout 60 -G -o /dev/null -d user=admin -d pass=fred http://my.firebrick.co.uk/1/dologin

Then you load the user interface. The FB in the filename is normally the OEM version. You may like to check the O field in info to confirm which is required. The WEN suffix means Web pages, EN (English).

curl -s -f -o /dev/null -F UPLOAD=@1740_2-02-569FB-Salorch.WEN http://my.firebrick.co.uk/1/upload

Again you need to wait for the flash to compleye, and the login again and fetch info to confirm the upload is complete. The V field in info says the version, and the L says the language. A language of NONE means the UI has not loaded.