Product SiteDocumentation Site

12.5. Hardware Firewall

All deployments should have a firewall protecting the management server; see Generic Firewall Provisions. Optionally, some deployments may also have a Juniper SRX firewall that will be the default gateway for the guest networks; see Section 12.5.2, “External Guest Firewall Integration for Juniper SRX (Optional)”.

12.5.1. Generic Firewall Provisions

The hardware firewall is required to serve two purposes:
  • Protect the Management Servers. NAT and port forwarding should be configured to direct traffic from the public Internet to the Management Servers.
  • Route management network traffic between multiple zones. Site-to-site VPN should be configured between multiple zones.
To achieve the above purposes you must set up fixed configurations for the firewall. Firewall rules and policies need not change as users are provisioned into the cloud. Any brand of hardware firewall that supports NAT and site-to-site VPN can be used.

12.5.2. External Guest Firewall Integration for Juniper SRX (Optional)

Note

Available only for guests using advanced networking.
CloudStack provides for direct management of the Juniper SRX series of firewalls. This enables CloudStack to establish static NAT mappings from public IPs to guest VMs, and to use the Juniper device in place of the virtual router for firewall services. You can have one or more Juniper SRX per zone. This feature is optional. If Juniper integration is not provisioned, CloudStack will use the virtual router for these services.
The Juniper SRX can optionally be used in conjunction with an external load balancer. External Network elements can be deployed in a side-by-side or inline configuration.
parallel-mode.png: adding a firewall and load balancer in parallel mode.
CloudStack requires the Juniper to be configured as follows:

Note

Supported SRX software version is 10.3 or higher.
  1. Install your SRX appliance according to the vendor's instructions.
  2. Connect one interface to the management network and one interface to the public network. Alternatively, you can connect the same interface to both networks and a use a VLAN for the public network.
  3. Make sure "vlan-tagging" is enabled on the private interface.
  4. Record the public and private interface names. If you used a VLAN for the public interface, add a ".[VLAN TAG]" after the interface name. For example, if you are using ge-0/0/3 for your public interface and VLAN tag 301, your public interface name would be "ge-0/0/3.301". Your private interface name should always be untagged because the CloudStack software automatically creates tagged logical interfaces.
  5. Create a public security zone and a private security zone. By default, these will already exist and will be called "untrust" and "trust". Add the public interface to the public zone and the private interface to the private zone. Note down the security zone names.
  6. Make sure there is a security policy from the private zone to the public zone that allows all traffic.
  7. Note the username and password of the account you want the CloudStack software to log in to when it is programming rules.
  8. Make sure the "ssh" and "xnm-clear-text" system services are enabled.
  9. If traffic metering is desired:
    1. a. Create an incoming firewall filter and an outgoing firewall filter. These filters should be the same names as your public security zone name and private security zone name respectively. The filters should be set to be "interface-specific". For example, here is the configuration where the public zone is "untrust" and the private zone is "trust":
      root@cloud-srx# show firewall
      filter trust {
          interface-specific;
      }
      filter untrust {
          interface-specific;
      }
    2. Add the firewall filters to your public interface. For example, a sample configuration output (for public interface ge-0/0/3.0, public security zone untrust, and private security zone trust) is:
      ge-0/0/3 {
          unit 0 {
              family inet {
                  filter {
                      input untrust;
                      output trust;
                  }
                  address 172.25.0.252/16;
              }
          }
      }
  10. Make sure all VLANs are brought to the private interface of the SRX.
  11. After the CloudStack Management Server is installed, log in to the CloudStack UI as administrator.
  12. In the left navigation bar, click Infrastructure.
  13. In Zones, click View More.
  14. Choose the zone you want to work with.
  15. Click the Network tab.
  16. In the Network Service Providers node of the diagram, click Configure. (You might have to scroll down to see this.)
  17. Click SRX.
  18. Click the Add New SRX button (+) and provide the following:
    • IP Address: The IP address of the SRX.
    • Username: The user name of the account on the SRX that CloudStack should use.
    • Password: The password of the account.
    • Public Interface. The name of the public interface on the SRX. For example, ge-0/0/2. A ".x" at the end of the interface indicates the VLAN that is in use.
    • Private Interface: The name of the private interface on the SRX. For example, ge-0/0/1.
    • Usage Interface: (Optional) Typically, the public interface is used to meter traffic. If you want to use a different interface, specify its name here
    • Number of Retries: The number of times to attempt a command on the SRX before failing. The default value is 2.
    • Timeout (seconds): The time to wait for a command on the SRX before considering it failed. Default is 300 seconds.
    • Public Network: The name of the public network on the SRX. For example, trust.
    • Private Network: The name of the private network on the SRX. For example, untrust.
    • Capacity: The number of networks the device can handle
    • Dedicated: When marked as dedicated, this device will be dedicated to a single account. When Dedicated is checked, the value in the Capacity field has no significance implicitly, its value is 1
  19. Click OK.
  20. Click Global Settings. Set the parameter external.network.stats.interval to indicate how often you want CloudStack to fetch network usage statistics from the Juniper SRX. If you are not using the SRX to gather network usage statistics, set to 0.

12.5.3. External Guest Load Balancer Integration (Optional)

CloudStack can optionally use a Citrix NetScaler or BigIP F5 load balancer to provide load balancing services to guests. If this is not enabled, CloudStack will use the software load balancer in the virtual router.
To install and enable an external load balancer for CloudStack management:
  1. Set up the appliance according to the vendor's directions.
  2. Connect it to the networks carrying public traffic and management traffic (these could be the same network).
  3. Record the IP address, username, password, public interface name, and private interface name. The interface names will be something like "1.1" or "1.2".
  4. Make sure that the VLANs are trunked to the management network interface.
  5. After the CloudStack Management Server is installed, log in as administrator to the CloudStack UI.
  6. In the left navigation bar, click Infrastructure.
  7. In Zones, click View More.
  8. Choose the zone you want to work with.
  9. Click the Network tab.
  10. In the Network Service Providers node of the diagram, click Configure. (You might have to scroll down to see this.)
  11. Click NetScaler or F5.
  12. Click the Add button (+) and provide the following:
    For NetScaler:
    • IP Address: The IP address of the SRX.
    • Username/Password: The authentication credentials to access the device. CloudStack uses these credentials to access the device.
    • Type: The type of device that is being added. It could be F5 Big Ip Load Balancer, NetScaler VPX, NetScaler MPX, or NetScaler SDX. For a comparison of the NetScaler types, see the CloudStack Administration Guide.
    • Public interface: Interface of device that is configured to be part of the public network.
    • Private interface: Interface of device that is configured to be part of the private network.
    • Number of retries. Number of times to attempt a command on the device before considering the operation failed. Default is 2.
    • Capacity: The number of networks the device can handle.
    • Dedicated: When marked as dedicated, this device will be dedicated to a single account. When Dedicated is checked, the value in the Capacity field has no significance implicitly, its value is 1.
  13. Click OK.
The installation and provisioning of the external load balancer is finished. You can proceed to add VMs and NAT or load balancing rules.