Use these APIs to manage static routes (set, remove) on scanner appliances. Your account must have the VLANs and static routes feature enabled.
Use the "set_routes" parameter to specify one or more static routes. The format for a single static route is
<IPv4_ADDRESS> | <NETMASK> | <IPv4_GATEWAY> | <VLAN_NAME> | <IPv6_ADDRESS> | <IPv6_GATEWAY>, with pipe (|) used as the delimiter.
To skip IPv4 attributes (IPv4 address, netmask and gateway), you must include an empty space in place of each attribute. Multiple static routes can be assigned using a comma separated list.
Attribute |
Description |
---|---|
<IPv4_ADDRESS> |
A valid IPv4 IP address (dotted quad), such as 10.10.26.0. Leave empty when specifying an IPv6 address. |
<NETMASK> |
A valid network mask (dotted quad), such as 255.255.255.0. Leave empty when specifying an IPv6 address. |
<IPv4_GATEWAY> |
A valid IPv4 address (dotted quad), such as 10.10.25.255. Leave empty when specifying an IPv6 address. |
<VLAN_NAME> |
A valid name (can be empty). The name can be a maximum of 256 ASCII characters. The character : (colon) is permitted. These characters are not permitted: , (comma), < (less than), > (greater than), " (double quote), & (ampersand), | (pipe), = (equals). |
<IPv6_ADDRESS> |
A valid IPv6 address (with or without the prefix), such as fdd1:0:1:107::500. |
<IPv6_GATEWAY> |
A valid IPv6 gateway address, such as 2001:470:8418:280d::1. |
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_routes=|||Name1|fdd1:0:1:107::500|2001:470:8418:280d::1" "https://<qualys_base_url>/api/2.0/fo/appliance/"
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_routes=192.0.0.0|255.255.255.0|10.100.11.157|Name2" "https://<qualys_base_url>/api/2.0/fo/appliance/"
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_routes=192.0.0.0|255.255.255.0|10.100.11.157|Name2,192.168.0.0|255.255.0.0|10.100.11.157|Name3,192.168.10.0||10.100.11.157|Name4,192.167.0.0|255.255.0.0|10.100.11.157|Name5|fdd1:0:1:107::500|2001:470:8418:280d::1,|||Name1|fdd1:0:1:107::500/64|2001:470:8418:280d::1" "https://<qualys_base_url>/api/2.0/fo/appliance/"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2018-07-20T11:45:03Z</DATETIME>
<TEXT>Virtual scanner updated successfully</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>126209</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
Set static routes on physical scanner appliances in the same way a virtual scanner appliances. The only difference is the URL endpoint.
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_routes=|||Name1|fdd1:0:1:107::500|2001:470:8418:280d::1" "https://<qualys_base_url>/api/2.0/fo/appliance/physical"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2018-07-20T11:58:06Z</DATETIME>
<TEXT>Physical scanner updated successfully</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>126209</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
Use the "set_routes" parameter and set it to " (empty string).
API Request
curl -u "USERNAME:PASSWD" -H "X-Requested-With: -d "id=43463&set_routes=""https://<qualys_base_url>/api/2.0/fo/appliance/?action=update"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2014-07-09T08:49:18Z</DATETIME>
<TEXT>Virtual scanner updated successfully</TEXT>
...
<platform API server>/api/2.0/simple_return.dtd